Skip to content

Commit

Permalink
linter5
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriJasnovidov committed Jan 9, 2024
1 parent c25e578 commit 1b9f143
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_general/bar_pass_data_preparing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def grouper_race(x):
if x == 7:
return 1
else:
else:
return 0


Expand All @@ -19,17 +19,16 @@ def grouper_gpa(x):


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']:
'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 = d.rename(columns={'gpa': 'target', 'race': 'attr'})
d = pd.get_dummies(d, drop_first=True)
d = d.dropna(how='any')

Expand Down

0 comments on commit 1b9f143

Please sign in to comment.