Skip to content

Commit 5fb5a6d

Browse files
author
Andrew Stewart
committed
testing docstrings
1 parent 7c35272 commit 5fb5a6d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

fundamentals_of_data_science/eda.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
def display_dict(m, precision=3):
8+
"""Displays a dictionaray"""
89
table = "<table>"
910
for item in m.items():
1011
table += ("<tr><th>{0}</th><td>{1:." + str(precision) + "f}</td></tr>").format(*item)
@@ -13,12 +14,14 @@ def display_dict(m, precision=3):
1314

1415

1516
def calculate_tukey_five(data):
17+
"""Calculate Tukey"""
1618
min, q1, q2, q3, max = np.concatenate([[np.min(data)], stats.mstats.mquantiles( data, [0.25, 0.5, 0.75]),[np.max(data)]])
1719
data = {"Min": min, "Q1": q1, "Q2": q2, "Q3": q3, "Max": max}
1820
return data
1921

2022

2123
def calculate_tukey_dispersion(five):
24+
"""Calculate Tukey dispersion"""
2225
data = {
2326
"Range": five["Max"] - five["Min"],
2427
"IQR": five["Q3"] - five["Q1"],
@@ -28,6 +31,7 @@ def calculate_tukey_dispersion(five):
2831

2932

3033
def restyle_boxplot(patch):
34+
"""Restyle boxplot"""
3135
## change color and linewidth of the whiskers
3236
for whisker in patch['whiskers']:
3337
whisker.set(color='#000000', linewidth=1)

fundamentals_of_data_science/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def summarize(formula, X, y, model, style='linear'):
4040

4141

4242
def linear_regression(formula, data=None, style="linear", params={}):
43+
"""Linear regression"""
4344
if data is None:
4445
raise ValueError( "The parameter 'data' must be assigned a non-nil reference to a Pandas DataFrame")
4546

@@ -84,6 +85,7 @@ def logistic(z):
8485

8586

8687
def logistic_regression( formula, data=None):
88+
"""Logistic regression"""
8789
if data is None:
8890
raise ValueError( "The parameter 'data' must be assigned a non-nil reference to a Pandas DataFrame")
8991

0 commit comments

Comments
 (0)