import pandas as pd
import numpy as np
import matplotlib.pylab as plt
%matplotlib inline
# 解决坐标轴刻度负号乱码
plt.rcParams['axes.unicode_minus']=False# 解决中文乱码问题
plt.rcParams['font.sans-serif']=['Simhei']from matplotlib.pylab import rcParams
rcParams['figure.figsize']=18,6import warnings
warnings.filterwarnings("ignore")
数据:1981-1990年澳大利亚墨尔本每日最低温度
#Importing data
df = pd.read_csv('Train_SU63ISt.csv')#Printing head
df.head()
ID
Datetime
Count
0
0
25-08-2012 00:00
8
1
1
25-08-2012 01:00
2
2
2
25-08-2012 02:00
6
3
3
25-08-2012 03:00
2
4
4
25-08-2012 04:00
2
#Printing tail
df.tail()
ID
Datetime
Count
18283
18283
25-09-2014 19:00
868
18284
18284
25-09-2014 20:00
732
18285
18285
25-09-2014 21:00
702
18286
18286
25-09-2014 22:00
580
18287
18287
25-09-2014 23:00
534
#Subsetting the dataset#Index 11856 marks the end of year 2013
df = pd.read_csv('Train_SU63ISt.csv', nrows =11856)#Creating train and test set #Index 10392 marks the end of October 2013
train=df[0:10392]
test=df[10392:]