# gapminder.tsv 파일을 읽어서 데이터 프레임 생성import pandas as pd df = pd.read_csv('gapminder.tsv', sep= '\t', encoding='UTF-8')print(df.iloc[0:5]) country continent year lifeExp pop gdpPercap0 Afghanistan Asia 1952 28.801 8425333 779.4453141 Afghanistan Asia 1957 30.332 9240934 820.8530302 Afghanistan Asia 1962 31.997 10267083 853.1007103 Afghanistan Asia 1967 34.020 11537966 836.1971384 Afghanistan Asia 1..
pandas
import osimport pandas as pdfile_path = os.path.join('..', 'scratch08', 'mpg.csv')df = pd.read_csv(file_path)print(df) manufacturer model displ year cyl ... drv cty hwy fl class0 audi a4 1.8 1999 4 ... f 18 29 p compact1 audi a4 1.8 1999 4 ... f 21 29 p compact2 audi a4 2.0 2008 4 ... f 20 31 p compact3 audi a4 2.0 2008 4 ... f 21 30 p compact4 audi a4 2.8 1999 6 ... f 16 26 p compact.. ... ... ..