Skip to content

BUG: GroupBy().fillna() performance regression #37149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 18, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,15 @@ def time_category_size(self):
class FillNA:
def setup(self):
N = 1500
self.df = DataFrame({
'group' : [1] * N + [2] * N,
'value' : [np.nan, 1.0] * N
}).set_index('group')

self.df = DataFrame(
{"group": [1] * N + [2] * N, "value": [np.nan, 1.0] * N}
).set_index("group")

def time_df_ffill(self):
self.df.groupby('group').fillna(method='ffill')
self.df.groupby("group").fillna(method="ffill")

def time_srs_ffill(self):
self.df.groupby('group')['value'].fillna(method='ffill')
self.df.groupby("group")["value"].fillna(method="ffill")


class GroupByMethods:
Expand Down