반응형
Notice
Recent Posts
Recent Comments
Link
목록UNIONALL (1)
말랑말랑제리스타일
[Pandas] DataFrame 합치기 - Union all 기능
RDBMS를 다뤄봤다면 누구나 알고있을 Union all 집합연산과 Join 기능이 판다스의 DataFrame에도 있습니다. 이번 장에서는 먼저 Union All 기능과 동일한 pandas.concat() 함수로 두개의 DataFrame을 합쳐보겠습니다. test_df = pd.read_csv("/content/test.csv") test_df_p1 = test_df.loc[test_df.Pclass == 1] test_df_p2 = test_df.loc[test_df.Pclass == 2] test_df_p3 = test_df.loc[test_df.Pclass == 3] # 0.DataFrame 생성 test_df_p12 = pd.concat([test_df_p1,test_df_p2]) # 1.p1과 ..
프로그래밍/파이썬
2022. 1. 23. 07:59