반응형
비전공자독학
-
[Python]_03_pandas_copy, append, max, min, count,..., gruop by, pivot, multi-index, unstack, rest_index()공부/Python 2021. 5. 28. 13:09
3# colab 사용 #강의 10 11 12 13 14 15 1. copy : 원본 데이터 유지시키고, 새로운 변수에 복사할 때 사용. - df.copy() new_df=df.copy() 2. row, column추가 - row 추가 : df.append({ '키' : '값' }, ingnore_index=True) - columns 추가 : df['국적']='대한민국' # row 추가- df.append({},ignore_index=True) # ignore_index=True을 해야 오류 안남 df=df.append({'이름':'테디','그룹':'테디그룹},ignore_index=True) # column 추가- df.['넣을 컬럼명']='넣을 값(문자)' or 넣을 값(숫자) # 문제: 이름이 지드..