Meteorological Agency [List of regional meteorological stations [ZIP compression format]](https://www.jma. go.jp/jma/kishou/know/amedas/ame_master.zip) is used. The contents of the zip file is only ʻame_master.csv`
python
import requests
import zipfile
import io
import pandas as pd
url = 'https://www.jma.go.jp/jma/kishou/know/amedas/ame_master.zip'
csv_name = 'ame_master.csv'
zip_res = requests.get(url)
with zipfile.ZipFile(io.BytesIO(zip_res.content)) as zip_f:
csv_data = zip_f.read(csv_name)
df = pd.read_csv(io.BytesIO(csv_data), encoding='cp932')
Recommended Posts