-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00578d1
commit 70df9e4
Showing
7 changed files
with
156 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dev/ | ||
statsy.egg-info | ||
dev.py | ||
dev.py | ||
src/statsy/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from .main import * | ||
|
||
e = summation(None,None,lambda n: 1/(math.factorial(n)), [[n for n in range (1000)]]) | ||
|
||
def pi()->Number: | ||
""" | ||
Returns pi | ||
""" | ||
return math.pi | ||
|
||
def e_specified(depth:int) -> Number: | ||
""" | ||
A specified depth to calculate the constant e. | ||
""" | ||
depth_list = [n for n in range (depth)] | ||
return summation(None,None,lambda n: 1/(math.factorial(n)), [depth_list]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from .main import * | ||
|
||
def Celcius_to_Fahrenheit(C:Number) -> Number: | ||
""" | ||
Returns the Fahrenheit value of a Celcius value. | ||
""" | ||
return (1.8 * C) + 32 | ||
|
||
def Fahrenheit_to_Celcius(F:Number) -> Number: | ||
""" | ||
Returns the Celcius value of a Fahrenheit value. | ||
""" | ||
return (F - 32)/1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from .main import * | ||
import math, statistics | ||
|
||
def ln(a:Number)->Number: | ||
""" | ||
Returns the natural log. | ||
""" | ||
return math.log(a) | ||
|
||
def log(base:Number,a:Number)->Number: | ||
""" | ||
Returns any logarithm for base and value. | ||
""" | ||
return (math.log10(a)/math.log10(base)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from .main import * | ||
from .Logarithms import * | ||
|
||
def Sturges_rule(number_of_points:Number)->Number: | ||
""" | ||
Sturges' rule for determining the approx. number of intervals for histograms. | ||
""" | ||
return round(1 + log(2,number_of_points)) | ||
|
||
def Rice_rule(number_of_points:Number)->Number: | ||
""" | ||
Rice rule for determining the approx. number of intervals for histograms. | ||
""" | ||
return round(2 * (root(3,number_of_points))) | ||
|
||
def arithmetic_mean(data:list)->Number: | ||
""" | ||
Returns the arithmetic mean of a list of data points. | ||
""" | ||
return (summation(None,None,None,[data])) / len(data) | ||
|
||
def median(data:list)->Number: | ||
""" | ||
Returns the simple mean of an ordered quantitative list. | ||
""" | ||
total_length = len(data) | ||
if total_length & 1: | ||
return data[int((total_length+1)/2)-1] | ||
else: | ||
return (data[ int((total_length/2)-1)] + data[int((total_length/2)+1)])/2 | ||
|
||
def mode(data:list)->any: | ||
""" | ||
A shortcut for statistics.mode(data) | ||
""" | ||
return statistics.mode(data) | ||
|
||
def trimean(data:list)->Number: | ||
""" | ||
Returns the trimean of a set of data. | ||
Be sure to order list in an increasing order. | ||
""" | ||
p25 = get_value_from_percentile(25,data) | ||
p50 = get_value_from_percentile(50,data) | ||
p75 = get_value_from_percentile(75,data) | ||
print(p25,p50,p75) | ||
|
||
return ( (p25 + (2 * p50) + p75 ) / 4 ) | ||
|
||
def geometric_mean(data:list)->Number: | ||
""" | ||
Returns the geometric mean of a list of data. | ||
""" | ||
return (product_notation(None,None,None,[data]) ** (1/len(data))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
from .main import * | ||
from .Conversion import * | ||
from .Constants import * | ||
from .Logarithms import * | ||
from .Methods import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters