Skip to content

stub for statistics #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions stdlib/3.4/statistics.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Stubs for statistics

from decimal import Decimal
from fractions import Fraction
import sys
from typing import Iterable, Optional, TypeVar

# Most functions in this module accept homogeneous collections of one of these types
_Number = TypeVar('_Number', float, Decimal, Fraction)

class StatisticsError(ValueError): ...

def mean(data: Iterable[_Number]) -> _Number: ...
if sys.version_info >= (3, 6):
def harmonic_mean(data: Iterable[_Number]) -> _Number: ...
def median(data: Iterable[_Number]) -> _Number: ...
def median_low(data: Iterable[_Number]) -> _Number: ...
def median_high(data: Iterable[_Number]) -> _Number: ...
def median_grouped(data: Iterable[_Number]) -> _Number: ...
def mode(data: Iterable[_Number]) -> _Number: ...
def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ...
def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ...
def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ...
def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ...