import pandas as pd
import datetime
def parser(x):
return datetime.datetime.strptime(x, '%Y %m %d %H')
dataset = pd.read_csv('../LSTM系列/LSTM多变量1/data_set/air_pollution.csv',
parse_dates=[['year', 'month', 'day', 'hour']], index_col=0, date_parser=parser)
dataset.drop('No', axis=1, inplace=True)
dataset.columns = ['pollution', 'dew', 'temp', 'press', 'wnd_dir', 'wnd_spd', 'snow', 'rain']
dataset.index.name = 'date'
dataset['pollution'].fillna(0, inplace=True)
dataset = dataset[24:]
print(dataset.head())