파이썬 정리/Module
-
파이썬 - Pandas - 타이타닉 분석파이썬 정리/Module 2024. 5. 7. 11:14
import pandas as pd df = pd.read_csv('C:/Users/demon/Documents/train.csv')df['Age']pd.isnull(df['Age'])df['Age'].fillna(0) # pd.isnull() == falsedf['Age'].sum()/len(df['Age'].index)#df['Age'].axes[0] for row , axes[1] for columnseries.fillna(0) : NaN값을 0로 바꿈 import pandas as pd df = pd.read_csv('C:/Users/demon/Documents/train.csv')ctFc = df.apply(lambda x : True if x['Sex'] == 'female' and x['Su..