df1 = pd.DataFrame({'time':[1, 2, 3, 4, 5, 6],
'price':[1100, 1200, 1300, 1400, 1500, 1600]})
df2 = pd.DataFrame({'time':[4, 5, 6, 7, 8, 9],
'price':[1400, 1500, 1600, 1700, 1800, 1900]})
데이터프레임 합치기
df = pd.concat([df1,df2], ignore_index=True)
ignore_index=True는 인덱스 초기화
데이터프레임 중복값 제거
df = df.drop_duplicates(['time']).reset_index(drop=True)
지정한 열을 기준으로 중복값을 제거
'Language > Python' 카테고리의 다른 글
[Python] Django 프로젝트 생성하기 (1) | 2024.12.17 |
---|---|
[Python] 네이버 카페 게시글 크롤링 selenium, bs4 (0) | 2023.09.09 |
[Python] len()과 size()의 차이점 (0) | 2021.01.30 |
[Python] Numpy 모듈 정리(zeros ,random,argmax) (0) | 2021.01.28 |
[Python] 함수를 매개변수로 사용하기 (0) | 2021.01.26 |