统计
import pandas as pd
import datetime
import pandas as pd
path6 = "E:/kaggle数据/exercise_data/wind.data"
df6 = pd.read_table(path6, sep = "\s+", parse_dates = [[0,1,2]])
df6.head()
def fix_century(x):
year = x.year-100 if x.year > 1989 else x.year
return datetime.date(year,x.month,x.day)
df6['Yr_Mo_Dy'] = df6['Yr_Mo_Dy'].apply(fix_century)
df6.head()
df['Yr_Mo_Dy'] = pd.to_datetime(df6['Yr_Mo_Dy'])
df6 = df6.set_index('Yr_Mo_Dy')
df6.head()
df6.isnull().sum()
df6.shape[0] - df6.isnull().sum()
df6.mean().mean()
loc_stats = pd.DataFrame()
loc_stats['min'] = df6.min()
loc_stats['max'] = df6.max(