MCPcopy
hub / github.com/dask/dask / test_mode_numeric_only

Function test_mode_numeric_only

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

Source from the content-addressed store, hash-verified

3823
3824
3825def test_mode_numeric_only():
3826 df = pd.DataFrame(
3827 {
3828 "int": [1, 2, 3, 4, 5, 6, 7, 8],
3829 "float": [1.0, 2.0, 3.0, 4.0, np.nan, 6.0, 7.0, 8.0],
3830 "dt": [pd.NaT] + [datetime(2010, i, 1) for i in range(1, 8)],
3831 "timedelta": pd.to_timedelta([1, 2, 3, 4, 5, 6, 7, np.nan]),
3832 }
3833 )
3834 ddf = dd.from_pandas(df, npartitions=2)
3835
3836 assert_eq(ddf.mode(numeric_only=False), df.mode(numeric_only=False))
3837 assert_eq(ddf.mode(), df.mode())
3838 assert_eq(ddf.mode(numeric_only=True), df.mode(numeric_only=True))
3839
3840
3841def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…