| 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 |


https://itsys.hansung.ac.kr/cgi-bin/onlineTest/viewpy4AI/onlinePy4AI.cgi?source=src/py/Ch12/code_12_23.py
Python for AI 실습게시판