Skip to content

Commit 0889edb

Browse files
committed
removed old janitor dataframe vestiges
1 parent a18422f commit 0889edb

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

notebooks/data.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ def load_finches_1975():
1818

1919
def load_finches(path):
2020
# Load the data
21-
df = pd.read_csv(path)
22-
23-
# Data cleaning methods. This is provided for you. Follow along the annotations
24-
# to learn what's going on.
25-
df = (jn.DataFrame(df) # wrap dataframe in a Janitor dataframe.
21+
df = (pd.read_csv(path)
2622
.clean_names() # clean column names
2723
.rename_column('blength', 'beak_length') # rename blength to beak_length (readability fix)
2824
.rename_column('bdepth', 'beak_depth') # rename bdepth to beak_depth (readability fix)
@@ -43,15 +39,20 @@ def load_baseball():
4339

4440

4541
def load_sterilization():
46-
df = pd.read_csv('../data/sterilization.csv', na_filter=True, na_values=['#DIV/0!'])
47-
df = jn.DataFrame(df).clean_names().label_encode('treatment')
42+
df = (
43+
pd.read_csv('../data/sterilization.csv', na_filter=True, na_values=['#DIV/0!'])
44+
.clean_names()
45+
.label_encode('treatment')
46+
)
4847
mapping = dict(zip(df['treatment'], df['treatment_enc']))
4948
return df, mapping
5049

5150

5251
def load_kruschke():
53-
df = pd.read_csv('../data/iq.csv', index_col=0) # comment out the path to the file for students.
54-
df = jn.DataFrame(df).label_encode('treatment')
52+
df = (
53+
pd.read_csv('../data/iq.csv', index_col=0) # comment out the path to the file for students.
54+
.label_encode('treatment')
55+
)
5556
return df
5657

5758

0 commit comments

Comments
 (0)