Commit Graph

4 Commits

Author SHA1 Message Date
Rohan R Bharadwaj
a98465230f
[mypy] Fix type annotations for maths directory (#5782)
* [mypy] Fix annotations in `maths/series/p_series.py`

* Update p_series.py

* Update p_series.py

* Remove from excluded in mypy.ini

* Type annotation for series

* Annotate maths/proth_number.py (properly)

* Remove from excluded in mypy.ini

* Annotate average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Remove from excluded in mypy.ini

* Fix annotations in gamma_recursive.py

* Remove from excluded in mypy.ini

* Annotations for geometric_series.py

* Update geometric_series.py

* Update mypy.ini

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update mypy.ini

* Update mypy.ini

* Update mypy.ini

* Update average_mode.py

* Update proth_number.py

* Update average_mode.py

* Update gamma_recursive.py

* Update proth_number.py

* Update mypy.ini

* Update geometric_series.py

* Update average_mode.py

* Update proth_number.py

* Update geometric_series.py

* Update geometric_series.py

* Update geometric_series.py

* Update p_series.py

* Update geometric_series.py

* Update p_series.py

* Update p_series.py

* Update geometric_series.py

* Update p_series.py

* Update p_series.py

* Remove data_structures/stacks/next_greater_element.py|

Co-authored-by: Christian Clauss <cclauss@me.com>
2021-11-07 16:13:58 +01:00
Grigoriy Hanin
40e357f688
Mistake in maths/average_mode.py fixed. (#4464)
A serious bug was addressed with this pull request. The mode function previously
didn't return the mode of the input list. Instead, it always returned the first value.
Due to lacking tests, the bug was never caught. This pull request also adds new
functionality to the function, allowing support for more than one mode.

See #4464 for details.

* * Mistake in average_mode.py fixed. The previous solution was to returnthe
value on the first loop iteration, which is not correct, more than that it
used to delete repeating values, so result's array and check array lost
relation between each other

* Type hint added

* redundant check_list deleted

Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>

* Suggestions resolved

* output typing changed to Any
* test cases added

* Black done

File formatted

* Unused statistics import

statistics only used in doctest, now they are imported in doctest

* Several modes support added

Several modes support added

* Comment fix

* Update maths/average_mode.py

Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>

* Suggestions added

Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>
2021-06-04 15:16:32 -05:00
matkosoric
7f04e5cd34
contribution guidelines checks (#1787)
* spelling corrections

* review

* improved documentation, removed redundant variables, added testing

* added type hint

* camel case to snake case

* spelling fix

* review

* python --> Python # it is a brand name, not a snake

* explicit cast to int

* spaces in int list

* "!= None" to "is not None"

* Update comb_sort.py

* various spelling corrections in documentation & several variables naming conventions fix

* + char in file name

* import dependency - bug fix

Co-authored-by: John Law <johnlaw.po@gmail.com>
2020-03-04 13:40:28 +01:00
LokiUvaraj
63433616c9 average_mode.py (#1491)
* Add files via upload

Finds the mode in the input data.

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Update average_mode.py

* Tabs do not belong in Python files!
2019-10-30 00:26:28 +01:00