AttributeError: 'DataFrame' object has no attribute 'mad'
in Pandas 2.0+
Hi everyone,
I'm trying to calculate the Mean Absolute Deviation (MAD) from a Pandas DataFrame using the .mad()
function. Here's my code:
python
importpandas as pd df = pd.DataFrame({'marks': [70, 75, 80, 85, 90]}) print("MAD (DataFrame):") print(df.mad())
But I'm getting the following error
AttributeError: 'DataFrame' object has no attribute 'mad'
I'm using Pandas version 2.0+.