인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

kyongsoolee's profile image
kyongsoolee

asked

[Revised Edition] The Complete Guide to Python Machine Learning

Sorting Pandas DataFrame and performing Aggregation function and Group by

agg([max, min])에서 max, min 외에 가능한 연산은?

Written on

·

282

0

titanic_df.groupby('Pclass')['Age'].agg([max, min])
여기서 max, min 대신에 다른걸 넣어봤는데,
sum은 되고 mean은 안되내요.
agg([])에 들어가는 연산은 한정되어 있나요?
통계python머신러닝 배워볼래요?

Answer 1

0

dooleyz3525님의 프로필 이미지
dooleyz3525
Instructor

안녕하십니까, 

아래와 같이 문자열로 변경해 보시지요. 

titanic_df.groupby('Pclass')['Age'].agg(['max', 'min', 'mean'])

감사합니다. 

kyongsoolee's profile image
kyongsoolee

asked

Ask a question