Skip to content

Commit

Permalink
Fix border format erros and update docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
l0o0 committed Nov 27, 2018
1 parent fb03bc5 commit b6214f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rosaceae/scorecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def replaceWOE(woes, data):
var_woe = woes[var]
for border in var_woe:
if isinstance(border, str) and ':' in border:
start, end = pd.to_numeric(border.split(':'))
start, end = pd.to_numeric(border[1:-1].split(':'))
flags = ((woe_data[var]>= start) & (woe_data[var]<end))
elif border == 'Miss':
flags = pd.isna(woe_data[var])
else:
flags = woe_data[var] == border
flags = woe_data[var].isin(border.split(','))
woe_data.loc[flags, var] = var_woe[border][0]
return woe_data

Expand Down
3 changes: 1 addition & 2 deletions rosaceae/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ def summary(data, verbose=False):
Q75: Third quartile. It splits off the lowest 75\% of data from the highest 25\%.
Max: Maximum value.
StDv: Standard deviation of a sample.
Neg: Number of negative values.
Pos: Number of positive values.
Uniq: Unique value.
OutLo: Number of outliers. Records below Q25-1.5*IQR, where IQR=Q75-Q25.
OutHi: Number of outliers. Records above Q75+1.5*IQR, where IQR=Q75-Q25.
'''
Expand Down

0 comments on commit b6214f8

Please sign in to comment.