-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ASV: add FrameMixedDtypesOps #55939
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
ASV: add FrameMixedDtypesOps #55939
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,37 @@ def time_op(self, op, dtype, axis): | |
self.df_func(axis=axis) | ||
|
||
|
||
class FrameMixedDtypesOps: | ||
params = [ops, [0, 1, None]] | ||
param_names = ["op", "axis"] | ||
|
||
def setup(self, op, axis): | ||
N = 1_000_000 | ||
df = pd.DataFrame( | ||
{ | ||
"f": np.random.normal(0.0, 1.0, N), | ||
"i": np.random.randint(0, N, N), | ||
"ts": pd.date_range(start="1/1/2000", periods=N, freq="h").tolist(), | ||
} | ||
) | ||
if op in ("sum", "skew", "kurt", "prod", "sem", "var") or ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you put this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved. |
||
(op, axis) | ||
in ( | ||
("mean", 1), | ||
("mean", None), | ||
("median", 1), | ||
("median", None), | ||
("std", 1), | ||
) | ||
): | ||
del df["ts"] | ||
quangngd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
self.df_func = getattr(df, op) | ||
|
||
def time_op(self, op, axis): | ||
self.df_func(axis=axis) | ||
|
||
|
||
class FrameMultiIndexOps: | ||
params = [ops] | ||
param_names = ["op"] | ||
|
Uh oh!
There was an error while loading. Please reload this page.