8000 TST/REF: collect DataFrame reduction tests by jbrockmendel · Pull Request #24914 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

TST/REF: collect DataFrame reduction tests #24914

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 12 commits into from
Feb 4, 2019
Prev Previous commit
Next Next commit
Merge branch 'master' of https://github.com/pandas-dev/pandas into tana
  • Loading branch information
jbrockmendel committed Jan 24, 2019
commit e87f5b8fcffb60d71a674688e5fc07384626a242
19 changes: 19 additions & 0 deletions pandas/tests/frame/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,25 @@ def test_mean(self, float_frame_with_na):
def test_product(self, float_frame_with_na):
assert_stat_op_calc('product', np.prod, float_frame_with_na)

@pytest.mark.parametrize('tz', [None, 'UTC'])
def test_mean_mixed_datetime_numeric(self, tz):
# https://github.com/pandas-dev/pandas/issues/24752
df = pd.DataFrame({"A": [1, 1],
"B": [pd.Timestamp('2000', tz=tz)] * 2})
result = df.mean()
expected = pd.Series([1.0], index=['A'])
tm.assert_series_equal(result, expected)

@pytest.mark.parametrize('tz', [None, 'UTC'])
def test_mean_excludeds_datetimes(self, tz):
# https://github.com/pandas-dev/pandas/issues/24752
# Our long-term desired behavior is unclear, but the behavior in
# 0.24.0rc1 was buggy.
df = pd.DataFrame({"A": [pd.Timestamp('2000', tz=tz)] * 2})
result = df.mean()
expected = pd.Series()
tm.assert_series_equal(result, expected)

# TODO: Ensure warning isn't emitted in the first place
@pytest.mark.filterwarnings("ignore:All-NaN:RuntimeWarning")
def test_median(self, float_frame_with_na):
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0