LoginSignup
4
2

More than 5 years have passed since last update.

台風の総数をグラフ化

Posted at

概要

気象庁のHPで過去の台風発生数がまとめてあるcsvファイルを見つけたので
総数をグラフで表してみる。

hr.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import csv
import math
import numpy as np
import sys, os
from matplotlib import pyplot

listage = []
listnum = []

with open('generation.csv', 'r',encoding='cp932') as f:
    reader = csv.reader(f)
    header = next(reader)  # ヘッダーを読み飛ばしたい時

    for row in reader:
        listage.append(row[0])
        listnum.append(row[13])
x = listage
y = listnum
pyplot.plot(x, y,)
pyplot.xticks([1960,1970,1980,1990,2000,2010], ["1960","1970","1980","1990","2000","2010"])
pyplot.xlabel("Year")
pyplot.show()

結果

ダウンロード.png

よく分からなかった

参照

気象庁:台風の発生数

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2