GOUPBY- Data Cleaning Walkthrough: Combining the Data

Screen Link:

My Code:

import numpy

grouped= class_size.groupby("DBN")
data["class_size"] = grouped

What I expected to happen:
I tried using groupby.mean() method as explained in Learn data science with Python and R projects but I am getting the error.

What actually happened:

Unable to coerce to Series, length must be 7: given 583

As shown in Learn data science with Python and R projects we use grouby.agg() method when we want to apply more than one aggregate method. But in this case, we only want to calculate mean() for all columns so why is groupby.mean() giving me this error?

Hey @bhumikagupta100366
I think it’s just a typing error, you should replace