Hi there!

I am a student studying computer science.

AI/Pandas 기초

12. 컬럼 내 유니크한 값 뽑아내고 갯수 확인하기

만능성구 2020. 4. 24. 19:30
728x90
df.job.unique()

array( ['teacher', 'student', 'developer', 'dentist', 'lawyer', 'banker', 'basketball player'], dtype=object)

 

종류별로 하나씩 가져온다.

 

df.job.value_counts()

 

teacher                    8

student                   5

lawyer                     2

banker                   2

developer               1

dentist                    1

basketball player        1

Name: job, dtype: int64

 

count도 할 수 있다.

728x90

'AI > Pandas 기초' 카테고리의 다른 글

13. 두개의 데이터프레임 합치기  (0) 2020.04.24
11. map, applymap 함수 활용  (0) 2020.04.24
10. apply 함수 활용  (0) 2020.04.24
09. NaN 찾아서 다른 값으로 변경하기  (0) 2020.04.24
08. 중복 데이터 삭제하기  (0) 2020.04.24