Skip to content

Commit bab4e43

Browse files
committed
drop lambda wrapper in pd.apply
1 parent 76b512d commit bab4e43

File tree

1 file changed

+2
-2
lines changed
  • _delphi_utils_python/delphi_utils/flash_eval

1 file changed

+2
-2
lines changed

_delphi_utils_python/delphi_utils/flash_eval/eval_day.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def outlier(df, iqr_list=None, replace=pd.DataFrame(), replace_use=False):
5353
iqr_spec_df2 = diff_df2_stack.iloc[1:, :]
5454
for _, (_, ldf) in enumerate(iqr_spec_df2.groupby(['weekday'])):
5555
iqr = ldf.groupby('state').apply(lambda x: x.val.quantile([lower, 0.5, upper]).T)
56-
iqr = iqr.apply(lambda x: fix_iqr(x), axis=1)
56+
iqr = iqr.apply(fix_iqr, axis=1)
5757
iqr['delta'] = 1.5 * (np.ceil(iqr[upper]) - np.floor(iqr[lower]))
5858
iqr['lower_bound'] = iqr[lower] - iqr['delta']
5959
iqr['upper_bound'] = iqr[upper] + iqr['delta']
@@ -126,7 +126,7 @@ def spike(x):
126126
group['state'] = x.name
127127
group_list.append(group)
128128

129-
all_frames_orig.apply(lambda x: spike(x), axis=0).to_list()
129+
all_frames_orig.apply(spike, axis=0).to_list()
130130
all_frames = pd.concat(group_list)
131131
outlier_df = all_frames.reset_index().sort_values(by=['state', 'ref']) \
132132
.reset_index(drop=True).copy()

0 commit comments

Comments
 (0)