Skip to content

Commit

Permalink
linter6
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriJasnovidov committed Jan 9, 2024
1 parent 1b9f143 commit b43f559
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/test_general/bar_pass_data_preparing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ def grouper_gpa(x):
return 1


def prepare_data(name='bar_pass_prediction'):
if name == 'bar_pass_prediction':
d = pd.read_csv('bar_pass_prediction.csv')
for x in ['ID', 'race1', 'race2', 'sex', 'bar', 'dnn_bar_pass_prediction', 'pass_bar', 'indxgrp2',
'gender', 'grad', 'Dropout', 'fulltime', 'lsat', 'zfygpa', 'ugpa', 'zgpa', 'other', 'asian',
'black', 'hisp']:
def prepare_data(name="bar_pass_prediction"):
if name == "bar_pass_prediction":
d = pd.read_csv("bar_pass_prediction.csv")
for x in ["ID", "race1", "race2", "sex", "bar", "dnn_bar_pass_prediction", "pass_bar", "indxgrp2",
"gender", "grad", "Dropout", "fulltime", "lsat", "zfygpa", "ugpa", "zgpa", "other", "asian",
"black", "hisp"]:
del d[x]

d['gpa'] = d['gpa'].apply(grouper_gpa)
d['race'] = d['race'].apply(grouper_race)
d = d.rename(columns={'gpa': 'target', 'race': 'attr'})
d["gpa"] = d["gpa"].apply(grouper_gpa)
d["race"] = d["race"].apply(grouper_race)
d = d.rename(columns={"gpa": "target", "race": "attr"})
d = pd.get_dummies(d, drop_first=True)
d = d.dropna(how='any')
d = d.dropna(how="any")

return d

0 comments on commit b43f559

Please sign in to comment.