Meteorologische Agentur [Liste der regionalen Wetterstationen [ZIP-Komprimierungsformat]](https: //www.jma. go.jp/jma/kishou/know/amedas/ame_master.zip) wird verwendet. Der Inhalt der Zip-Datei ist nur "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