1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 12.23 µ¥ÀÌÅ͸¦ Å©±â¿¡ µû¶ó ³ª¿ÇÏÀÚ : Á¤·Ä, 334ÂÊ # import pandas as pd import matplotlib.pyplot as plt countries_df = pd.read_csv('d:/data/countries.csv', index_col = 0) sorted = countries_df.sort_values('population') print(sorted) ################################ countries_df = pd.read_csv('d:/data/countries.csv', index_col = 0) countries_df.sort_values('population', inplace = True) print(countries_df) ################################# countries = pd.read_csv('d:/data/countries.csv', index_col = 0, encoding='CP949') countries.sort_values(['population', 'area'], ascending = False, inplace = True) print(countries) | cs |