2021 - 07 - 07
판다스 책 공부하기 정규화부터~ import pandas as pd import numpy as np df = pd.read_csv('auto-mpg.csv',header= None) df.columns = ['mpg','cylinders','displacement','horsepower','weight', 'acceleration','model year','origin','name'] df['horsepower'].replace('?',np.nan, inplace = True) df.dropna(subset=['horsepower'],axis=0,inplace=True) df['horsepower'] = df['horsepower'].astype('float') print(df.horsepower.de..