Skip to content

Commit

Permalink
Fix percentile bug
Browse files Browse the repository at this point in the history
  • Loading branch information
luis11011 committed Jan 6, 2022
1 parent 5a3798a commit 488af59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions optimus/engines/base/columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,6 @@ def agg_exprs(self, cols="*", funcs=None, *args, compute=True, tidy=True, parall
agg_result = {func.__name__: {col_name: self.exec_agg(func(df.data[col_name], *args), compute=False) for
col_name in cols} for func in funcs}


@self.F.delayed
def compute_agg(values):
return convert_numpy(format_dict(values, tidy))
Expand Down Expand Up @@ -1455,7 +1454,7 @@ def percentile(self, cols="*", values=None, relative_error=RELATIVE_ERROR, estim

if values is None:
values = [0.25, 0.5, 0.75]
return df.cols.agg_exprs(cols, self.F.percentile, values, relative_error, estimate, tidy=tidy, compute=True)
return df.cols.agg_exprs(cols, self.F.percentile, values, relative_error, estimate, tidy=tidy, compute=compute)

def median(self, cols="*", relative_error=RELATIVE_ERROR, tidy=True, compute=True):
"""
Expand Down
2 changes: 1 addition & 1 deletion optimus/engines/base/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def percentile(self, series, values=0.5, error=False, estimate=False):
if not len(_series):
return np.nan
else:
return self.delayed(self._format_to_dict(_series.quantile(values)))
return self.delayed(self._format_to_dict)(_series.quantile(values))

# def radians(series):
# return series.to_float().radians()
Expand Down

0 comments on commit 488af59

Please sign in to comment.