TIL(24.08.18.)

codataffee·2024년 8월 18일

TIL

목록 보기
132/135
post-thumbnail

#INTRO

지렁이 게임 중독..


#코드카타

  • PANDAS

    • .sort_values() 활용하여 id 순 정렬하기

      # by = 'id' (아이디 기준 정렬), inplace = True (원본 데이터 대체)
      person.sort_values(by='id', inplace=True)
      
    • .drop_duplicates() 메서드로 중복 제거하기

      # subset = 'email' (email 컬럼의 중복 제거), 
      # keep = 'first' (중복된 값 중 처음으로 나온 값을 유지)
      person.drop_duplicates(subset='email', keep='first', inplace=True)


#OUTRO

오늘의 한 줄.

캠프 수료 전 마지막 주말 끝 !

profile
커피 좋아하는 데이터 꿈나무

0개의 댓글