御前崎の気象データをグラフ化する。

5月1日~8月17日まで

気象庁のデータを少し加工し、excelのデータから読み込む。

データの読み込みは絶対パスで設定しては\は2つ重ねることが必要です。
グラフは折れ線と棒で示してみました。

In [1]:
%matplotlib inline
import pandas as pd
df = pd.read_excel("c:\\Users\\user\\Documents\\Python Scripts\\omaezaki6.xlsx", sheet_name="Sheet3",header=1, encoding="SHIFT_JIS")
##御前崎の気温データ7月~8月
df.plot.bar(x="年月日",y="気温差")
df.plot.line(x="年月日",y="日照時間")
df.plot.bar(x="年月日",y="最高気温")
df.plot.bar(x="年月日",y="最低気温")
df
Out[1]:
年月日 最高気温 平均気温 最低気温 気温差 日照時間 降水量
0 2018-07-26 30.4 26.9 25.3 5.1 2.9 0.0
1 2018-07-27 30.7 27.3 24.8 5.9 9.0 0.0
2 2018-07-28 30.4 25.8 22.1 8.3 1.7 55.0
3 2018-07-29 30.8 27.0 24.8 6.0 8.1 5.5
4 2018-07-30 30.8 27.7 25.8 5.0 13.1 0.0
5 2018-07-31 31.1 27.6 25.7 5.4 13.4 0.0
6 2018-08-01 30.5 27.7 25.1 5.4 12.2 0.0
7 2018-08-02 31.5 28.5 26.8 4.7 10.8 0.0
8 2018-08-03 32.6 28.5 25.9 6.7 10.2 0.0
9 2018-08-04 31.7 28.6 26.9 4.8 9.2 0.0
10 2018-08-05 31.8 28.8 27.1 4.7 11.1 0.0
11 2018-08-06 33.7 29.5 26.3 7.4 11.3 0.0
12 2018-08-07 31.0 28.4 26.8 4.2 8.4 0.0
13 2018-08-08 31.1 28.1 24.4 6.7 2.6 0.0
14 2018-08-09 31.1 28.7 27.0 4.1 12.5 0.0
15 2018-08-10 31.7 28.7 27.4 4.3 9.6 0.0
16 2018-08-11 31.2 28.6 27.0 4.2 6.4 0.0
17 2018-08-12 32.2 28.4 26.4 5.8 4.1 12.5
18 2018-08-13 31.6 28.3 26.1 5.5 6.3 0.0
19 2018-08-14 31.7 28.6 25.6 6.1 9.9 0.0
20 2018-08-15 31.2 27.0 25.1 6.1 4.8 15.5
21 2018-08-16 31.2 28.0 25.1 6.1 8.1 7.0
22 2018-08-17 30.2 26.7 22.6 7.6 11.2 0.0
In [2]:
%matplotlib inline
import pandas as pd
df = pd.read_excel("c:\\Users\\user\\Documents\\Python Scripts\\omaezaki6.xlsx", sheet_name="Sheet2",header=1, encoding="SHIFT_JIS")
#df.plot.scatter(x=["5月日"],y=["最高気温"])
df.plot.bar(x="年月日",y="気温差")
df.plot.line(x="年月日",y="日照時間")
df.plot.bar(x="年月日",y="最高気温")
df.plot.bar(x="年月日",y="最低気温")
df
Out[2]:
年月日 最高気温 平均気温 最低気温 気温差 日照時間
0 2018-07-01 29.0 26.1 24.4 4.6 10.4
1 2018-07-02 29.2 26.0 23.1 6.1 11.2
2 2018-07-03 29.0 25.8 24.2 4.8 9.3
3 2018-07-04 29.2 26.0 23.7 5.5 2.7
4 2018-07-05 27.7 25.6 24.6 3.1 0.9
5 2018-07-06 25.7 24.9 23.2 2.5 0.0
6 2018-07-07 27.6 25.1 23.4 4.2 3.4
7 2018-07-08 29.4 25.6 23.2 6.2 5.6
8 2018-07-09 29.5 26.2 23.2 6.3 10.5
9 2018-07-10 30.0 26.6 23.6 6.4 13.2
10 2018-07-11 29.7 26.8 24.6 5.1 10.2
11 2018-07-12 28.7 25.9 24.9 3.8 1.0
12 2018-07-13 31.7 27.4 24.1 7.6 10.4
13 2018-07-14 31.5 28.2 25.2 6.3 13.2
14 2018-07-15 31.8 28.4 26.1 5.7 11.7
15 2018-07-16 31.7 28.4 26.1 5.6 9.8
16 2018-07-17 30.8 28.3 27.1 3.7 4.6
17 2018-07-18 31.7 28.5 26.8 4.9 6.1
18 2018-07-19 31.9 28.8 26.5 5.4 10.1
19 2018-07-20 31.9 28.7 25.8 6.1 12.8
20 2018-07-21 32.2 28.7 25.7 6.5 11.8
21 2018-07-22 32.3 29.0 27.2 5.1 9.9
22 2018-07-23 32.7 29.4 26.9 5.8 10.0
23 2018-07-24 32.4 29.1 27.1 5.3 10.6
24 2018-07-25 32.0 28.7 26.0 6.0 8.2
In [3]:
%matplotlib inline
import pandas as pd
df = pd.read_excel("c:\\Users\\user\\Documents\\Python Scripts\\omaezaki6.xlsx", sheet_name="sheet1",header=1, encoding="SHIFT_JIS")
#df.plot.scatter(x=["5月日"],y=["最高気温"])
df.plot.bar(x="年月日",y="気温差")
df.plot.line(x="年月日",y="日照時間")
df.plot.bar(x="年月日",y="最高気温")
df
Out[3]:
年月日 最高気温 平均気温 最低気温 気温差 日照時間
0 2018/6/1 24.3 20.5 16.1 8.2 8.0
1 2018/6/2 25.0 21.1 18.0 7.0 13.3
2 2018/6/3 25.2 21.7 18.3 6.9 11.5
3 2018/6/4 25.6 22.0 18.6 7.0 12.9
4 2018/6/5 25.0 22.0 18.8 6.2 10.4
5 2018/6/6 21.5 19.5 17.7 3.8 0.0
6 2018/6/7 24.1 21.0 19.2 4.9 5.2
7 2018/6/8 25.8 21.9 18.5 7.3 6.2
8 2018/6/9 27.4 23.7 21.4 6.0 12.0
9 2018/6/10 23.4 21.9 20.7 2.7 0.0
10 2018/6/11 27.2 23.0 20.9 6.3 0.5
11 2018/6/12 26.7 23.8 20.9 5.8 13.3
12 2018/6/13 24.9 21.9 18.7 6.2 7.1
13 2018/6/14 26.0 22.5 20.0 6.0 6.2
14 2018/6/15 22.3 21.2 19.8 2.5 0.1
15 2018/6/16 21.9 19.2 17.3 4.6 2.6
16 2018/6/17 24.3 20.7 17.2 7.1 9.6
17 2018/6/18 21.9 20.3 18.5 3.4 0.3
18 2018/6/19 25.4 21.9 18.6 6.8 2.9
19 2018/6/20 23.5 21.4 19.3 4.2 0.0
20 2018/6/21 23.4 22.0 20.9 2.5 0.0
21 2018/6/22 25.8 22.6 20.3 5.5 11.4
22 2018/6/23 21.0 19.3 18.2 2.8 0.0
23 2018/6/24 24.7 21.2 18.5 6.2 6.2
24 2018/6/25 27.6 23.4 20.2 7.4 12.3
25 2018/6/26 26.9 23.6 21.1 5.8 4.9
26 2018/6/27 27.8 24.8 22.5 5.3 7.0
27 2018/6/28 28.1 24.9 23.7 4.4 2.9
In [4]:
%matplotlib inline
import pandas as pd
df = pd.read_excel("c:\\Users\\user\\omaezaki.xlsx", sheet_name="Sheet1",header=1, encoding="SHIFT_JIS")
#df.plot.scatter(x=["5月日"],y=["最高気温"])
df.plot.bar(x="年月日",y="気温差")
df.plot.line(x="年月日",y="日照時間")
df.plot.bar(x="年月日",y="最高気温")
df
Out[4]:
年月日 最高気温 平均気温 最低気温 気温差 日照時間
0 2018-05-01 23.1 19.2 14.5 8.6 12.4
1 2018-05-02 21.8 18.5 16.5 5.3 0.9
2 2018-05-03 22.6 19.7 16.0 6.6 2.3
3 2018-05-04 19.5 16.3 13.0 6.5 12.0
4 2018-05-05 21.3 16.8 10.6 10.7 12.1
5 2018-05-06 22.8 19.2 13.8 9.0 10.7
6 2018-05-07 20.5 17.5 15.0 5.5 0.0
7 2018-05-08 18.4 15.3 13.2 5.2 0.0
8 2018-05-09 17.8 14.6 12.4 5.4 0.1
9 2018-05-10 21.1 16.1 11.8 9.3 12.7
10 2018-05-11 20.2 16.8 12.9 7.3 11.4
11 2018-05-12 22.1 17.9 13.9 8.2 11.3
12 2018-05-13 20.2 18.6 17.0 3.2 0.0
13 2018-05-14 23.7 20.2 17.5 6.2 12.8
14 2018-05-15 24.7 20.5 17.1 7.6 12.0
15 2018-05-16 23.6 20.5 17.5 6.1 10.8
16 2018-05-17 23.7 21.1 19.6 4.1 6.8
17 2018-05-18 24.4 21.5 19.5 4.9 4.9
18 2018-05-19 23.6 20.4 18.0 5.6 10.5
19 2018-05-20 20.6 17.9 16.0 4.6 5.7
20 2018-05-21 23.3 18.6 14.4 8.9 7.7
21 2018-05-22 23.9 19.8 15.6 8.3 12.6
22 2018-05-23 20.3 18.8 17.9 2.4 0.2
23 2018-05-24 25.6 21.3 18.0 7.6 10.9
24 2018-05-25 24.8 21.4 18.9 5.9 8.5
25 2018-05-26 23.2 20.7 18.0 5.2 0.1
26 2018-05-27 24.7 21.1 16.2 8.5 12.2
27 2018-05-28 24.2 21.7 20.3 3.9 0.1
28 2018-05-29 25.4 21.8 19.4 6.0 2.9
29 2018-05-30 22.5 20.5 18.1 4.4 0.0
30 2018-05-31 20.8 19.0 17.8 3.0 0.0
31 2018-06-01 24.3 20.5 16.1 8.2 8.0