Skip to content

ENH: add np.nan funcs to _cython_table #21123

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

Closed
Closed
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
comments addressed for adding nan_funcs to _cython_table
  • Loading branch information
tp committed May 21, 2018
commit f91b71635af6aedfbf337c4a30197680c9e13de6
2 changes: 1 addition & 1 deletion pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def tz_aware_fixture(request):
# GH 21123
params=list(sorted(pd.core.base.SelectionMixin._cython_table.items(),
key=lambda x: x[0].__name__)),
ids=lambda x: "({}-{!r})".format(x[0].__name__, x[1]),
ids=lambda x: "({}-{!r})_fixture".format(x[0].__name__, x[1]),
)
def cython_table_items(request):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add _fixture to the end of the name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

"""
Expand Down
15 changes: 8 additions & 7 deletions pandas/tests/frame/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,10 +1072,11 @@ def test_agg_function_input(self, df, cython_table_items):
# etc.
# GH21123
np_func, str_func = cython_table_items

tm.assert_almost_equal(df.agg(np_func),
df.agg(str_func),
)
tm.assert_almost_equal(df.agg(np_func, axis=1),
df.agg(str_func, axis=1),
)
if str_func in ('cumprod', 'cumsum'):
tm.assert_frame_equal(df.agg(np_func), df.agg(str_func))
tm.assert_frame_equal(df.agg(np_func, axis=1),
df.agg(str_func, axis=1))
else:
tm.assert_series_equal(df.agg(np_func), df.agg(str_func))
tm.assert_series_equal(df.agg(np_func, axis=1),
df.agg(str_func, axis=1))
7 changes: 4 additions & 3 deletions pandas/tests/series/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ def test_agg_function_input(self, series, cython_table_items):
# GH21123
np_func, str_func = cython_table_items

tm.assert_almost_equal(series.agg(np_func),
series.agg(str_func),
)
if str_func in ('cumprod', 'cumsum'):
tm.assert_series_equal(series.agg(np_func), series.agg(str_func))
else:
tm.assert_almost_equal(series.agg(np_func), series.agg(str_func))