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

Function _drop_mean

dask/dataframe/tests/test_dataframe.py:72–81  ·  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

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

Callers 2

test_describeFunction · 0.70

Calls 2

dropMethod · 0.80
dropnaMethod · 0.45

Tested by

no test coverage detected