Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Nicole Buckenwolf](https://secure.gravatar.com/avatar/639234412b2010a491a3420d0d4c10df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nicole Buckenwolf
8,721 PointsStumped by pandas update this time - help with groupby
Whoops not sure if it included the lesson - linking just in case, this question is about Exploration Methods in Introduction to Pandas.
Hi all, google isn't helping me as much this time so I'm hoping someone can chime in.
When I try to run the aggregations like
users.mean()
I get a TypeError. I did locate the pandas documentation where it says this has changed since the course was made. Using this I was able to figure out how to aggregate individual columns, like
users.email_verified(mean)
But I'm having trouble figuring out how to get the same output as in the lesson, where they show all of the possible columns that can be aggregated:
email_verified 0.818947
referral_count 3.429474
balance 49.933263
dtype: float64
Can anyone assist? Thank you!
2 Answers
![Travis Alstrand](https://uploads.teamtreehouse.com/production/profile-photos/11658224/micro_travis.jpg)
Travis Alstrand
Data Analysis Techdegree Graduate 49,407 PointsHi there Nicole Buckenwolf !
It's been a while since I've played with Pandas, but from looking around, I believe you may be able to get similar results using the agg()
function. I don't have a project open to test it with unfortunately, but I'd give this a shot and see if it's close to what you're looking for.
aggregations = users.agg({'email_verified': 'mean', 'referral_count': 'mean', 'balance': 'mean'})
print(aggregations)
I hope this works out, I'll have to get back into the Pandas game a bit and test things out soon!
![Nicole Buckenwolf](https://secure.gravatar.com/avatar/639234412b2010a491a3420d0d4c10df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nicole Buckenwolf
8,721 PointsThat worked! Seems obvious now that I look at it. Thank you!
![Travis Alstrand](https://uploads.teamtreehouse.com/production/profile-photos/11658224/micro_travis.jpg)
Travis Alstrand
Data Analysis Techdegree Graduate 49,407 PointsOh good! I'm glad that it worked out for you!!
You're very welcome!