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

Function _drop_mean

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

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

Callers 2

test_describeFunction · 0.70

Calls 2

dropMethod · 0.80
dropnaMethod · 0.45

Tested by

no test coverage detected