Pandas 예제
·
study/python
# 데이터프레임에서 다른 데이터프레임과 병합 df4 = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'foo'], 'B': ['one', 'one', 'two', 'three', 'two', 'two', 'one', 'three'], 'C': np.random.randn(8)}) pd.merge(df, df4, on='A') # 인덱스 확인 df.index # 컬럼 확인 df.columns # 데이터프레임에서 값만 확인 df.values # 데이터프레임에서 describe() 함수 사용 df.describe() # 데이터 정렬 df.sort_values(by='B', ascending=False) # 컬럼 선택 df['A'] ..