0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

インターネットのzipファイルを解凍する

Posted at

インターネット上のzipファイルを解凍する

気象庁地域気象観測所一覧 [ZIP圧縮形式]を使用する。
zipファイルの中身は、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')
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?