MCPcopy
hub / github.com/pandas-dev/pandas / test_nanmean

Method test_nanmean

pandas/tests/test_nanops.py:1162–1174  ·  view source on GitHub ↗
(self, unit)

Source from the content-addressed store, hash-verified

1160 # Enabling mean changes the behavior of DataFrame.mean
1161 # See https://github.com/pandas-dev/pandas/issues/24752
1162 def test_nanmean(self, unit):
1163 dti = pd.date_range("2016-01-01", periods=3).as_unit(unit)
1164 expected = dti[1]
1165
1166 for obj in [dti, dti._data]:
1167 result = nanops.nanmean(obj)
1168 assert result == expected
1169
1170 dti2 = dti.insert(1, pd.NaT)
1171
1172 for obj in [dti2, dti2._data]:
1173 result = nanops.nanmean(obj)
1174 assert result == expected
1175
1176 @pytest.mark.parametrize("constructor", ["M8", "m8"])
1177 def test_nanmean_skipna_false(self, constructor, unit):

Callers

nothing calls this directly

Calls 2

as_unitMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected