GroupBy.
mad
Compute mean absolute deviation of groups, excluding missing values.
New in version 3.4.0.
Deprecated since version 3.4.0.
See also
pyspark.pandas.Series.groupby
pyspark.pandas.DataFrame.groupby
Examples
>>> df = ps.DataFrame({"A": [1, 2, 1, 1], "B": [True, False, False, True], ... "C": [3, 4, 3, 4], "D": ["a", "b", "b", "a"]})
>>> df.groupby("A").mad() B C A 1 0.444444 0.444444 2 0.000000 0.000000
>>> df.B.groupby(df.A).mad() A 1 0.444444 2 0.000000 Name: B, dtype: float64