MCPcopy Create free account
hub / github.com/dask/dask / test_mode_numeric_only

Function test_mode_numeric_only

dask/dataframe/tests/test_dataframe.py:3837–3850  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3835
3836
3837def test_mode_numeric_only():
3838 df = pd.DataFrame(
3839 {
3840 "int": [1, 2, 3, 4, 5, 6, 7, 8],
3841 "float": [1.0, 2.0, 3.0, 4.0, np.nan, 6.0, 7.0, 8.0],
3842 "dt": [pd.NaT] + [datetime(2010, i, 1) for i in range(1, 8)],
3843 "timedelta": pd.to_timedelta([1, 2, 3, 4, 5, 6, 7, np.nan]),
3844 }
3845 )
3846 ddf = dd.from_pandas(df, npartitions=2)
3847
3848 assert_eq(ddf.mode(numeric_only=False), df.mode(numeric_only=False))
3849 assert_eq(ddf.mode(), df.mode())
3850 assert_eq(ddf.mode(numeric_only=True), df.mode(numeric_only=True))
3851
3852
3853def test_getitem_meta():

Callers

nothing calls this directly

Calls 3

modeMethod · 0.95
assert_eqFunction · 0.90
modeMethod · 0.45

Tested by

no test coverage detected