[pandas] 행 변경하기 append, loc, drop, index, rename
가공할 데이터 준비 import pandas as pd df = pd.read_csv('data/scores.csv') df.index = range(100,3100,100) df.head(3) """ namekorengmath 100Aiden100.090.095.0 200Charles90.080.075.0 300Danial95.0100.0100.0 """ 마지막에 행 추가하고 인덱스 다시 지정하기 데이터프레임.append(추가할데이터, ignore_index=True) 추가할 데이터는 딕셔너리 형태로 전달 : {컬럼1:값1, 컬럼2:값2,...} 데이터프레임의 끝에 행 추가 기존 인덱스는 무시하고, 인덱스가 새롭게 생성된다. new_value = {'name':'Python','kor':80,'eng'..
2023. 5. 11.