Skip to content
RED SAGSkills
medium10 pts · first answer countspandas

groupby with transform

What does this pandas code produce?

df["city_avg"] = df.groupby("city")["sales"].transform("mean")
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions