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

Function _drop_mean

dask/dataframe/tests/test_dataframe.py:74–83  ·  view source on GitHub ↗

TODO: In pandas 2.0, mean is implemented for datetimes, but Dask returns None.

(df, col=None)

Source from the content-addressed store, hash-verified

72
73
74def _drop_mean(df, col=None):
75 """TODO: In pandas 2.0, mean is implemented for datetimes, but Dask returns None."""
76 if isinstance(df, pd.DataFrame):
77 df.at["mean", col] = np.nan
78 df = df.dropna(how="all")
79 elif isinstance(df, pd.Series):
80 df = df.drop(labels=["mean"], errors="ignore")
81 else:
82 raise NotImplementedError("Expected Series or DataFrame with mean")
83 return df
84
85
86def test_Dataframe():

Callers 2

test_describeFunction · 0.70

Calls 2

dropMethod · 0.80
dropnaMethod · 0.45

Tested by

no test coverage detected