1 2 3 4 5 6 7 8 9 10 11 12 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 12.19 µ¥ÀÌÅÍ ±¸Á¶¸¦ º¯°æÇØ º¸ÀÚ, 328ÂÊ # import pandas as pd df_1 = pd.DataFrame({'item' : ['ring0', 'ring0', 'ring1', 'ring1'], 'type' : ['Gold', 'Silver', 'Gold', 'Bronze'], 'price': [20000, 10000, 50000, 30000]}) df_2 = df_1.pivot(index='item', columns='type', values='price') print(df_2) | cs |