LoginSignup
8
3

More than 5 years have passed since last update.

地域経済分析システム(RESAS:リーサス) ダウンロードデータ

Posted at

RESASのCSVまとめてみました。

zip のままで操作できる python script つけました。

  • ファイルが文字化けするので、zipfile.py の一部変更します。 (ex) anaconda の例です。

anaconda3/lib/python3.5/zipfile.py を変更します。
ファイル名のencoding が、utf-8 でないときに、cp437 だと
いうことになってしまうので、cp932(shift-jis のようなもの)に変更します。

1126             if flags & 0x800:
1127                 # UTF-8 file names extension
1128                 filename = filename.decode('utf-8')
1129             else:
1130                 # Historical ZIP filename encoding
1131                 #filename = filename.decode('cp437')
                     filename = filename.decode('cp932')

import io
from pprint import pprint as pp
import zipfile
# https://drive.google.com/file/d/0B-OqLsq_blQwdndNblB4NnFuM2c/view?usp=sharing
# をダウンロードして、data/reasa_all_pre.zip に保存してください。
z = zipfile.ZipFile('data/resas_all_pre.zip')

for one in z.namelist():
    z2 = zipfile.ZipFile(io.BytesIO(z.open(one).read()))
    pp(z2.infolist()[0].filename)

実行すると下記が表示されます。

'agriculture-all_20160129/農業花火図_旧市区町村.csv'
'agriculture-crops_20160129/01_集計データ/'
'agriculture-land_20160129/01_集計データ/'
'agriculture-sales_20160129/01_集計データ/'
'commerce-all_20160930/消費マップ_商業花火図_業種別_市区町村.csv'
'commerce-regional-comparison_20160930/消費マップ_商業花火図_業種別_市区町村.csv'
'fishery-sea_20160325/【増減率】水産業マップ_海面漁業マップ_販売金額_市区町村.csv'
'forestry-forester_20160930/林業マップ_林業者分析_市区町村.csv'
'forestry-income_20160129/01_集計データ/'
'forestry-mountain-forest_20160930/林業マップ_山林分析_市区町村.csv'
'industry-all_20160930/01_企業数(企業単位)/'
'industry-globalmarket_20160129/集計データ/'
'industry-patent_20160129.zip/特許分布図_トップ画面_01_北海道.csv'
'industry-power_20160129/01_トップ画面/'
'industry-regional-comparison_20160930/'
'inlandwaterfisheries-boat-and-farming_20160930/内水面漁業マップ_漁船・養殖面積分析_全国.csv'
'inlandwaterfisheries-sales_20160930/内水面漁業マップ_内水面漁獲物等販売金額_主要経営体.csv'
'local-government-finance_20161011/自治体比較マップ_自治体財政状況の比較_市区町村.csv'
'municipality-company_20160720/01_集計データ/'
'municipality-employee_20160720/01_集計データ/'
'municipality-foundation_20160129/創業比率_市区町村.csv'
'municipality-job_20160129/有効求人倍率_全国_職業大分類.csv'
'municipality-labor_20160224/労働生産性_市区町村_業種中分類.csv'
'municipality-manufacture_20160826/01_集計データ/'
'municipality-plant_20160720/01_集計データ/'
'municipality-property-tax_20160720/01_集計データ/'
'municipality-resident-tax-corporate_20160720/01_集計データ/'
'municipality-sales_20160129/01_集計データ/'
'municipality-surplus_20160129/黒字赤字企業比率_市区町村_業種中分類.csv'
'municipality-taxes_20160720/01_集計データ/'
'municipality-value_20160224/付加価値額_市区町村_業種中分類.csv'
'municipality-wages_20160129/一人当たり賃金_全国_業種中分類.csv'
'overseas-transaction_20160930/産業マップ_企業の海外取引分析.csv'
'population-composition_20160129/01_トップ画面(総人口)/'
'population-future_20160129/01_トップ画面/'
'population-nature_20160129/01_合計特殊出生率と人口推移/'
'population-society_20160129/02_人口移動(グラフ分析)/'
'population-sum_20160129/01_トップ画面(人口増減率)/'
'地域経済循環分析(簡易解説書)/地域経済循環マップ(概要).pdf'
'research-and-development_20160930/産業マップ_研究開発費の地域間比較_研究開発費増減率の要因分析.csv'
'seafishing-boat-and-farming_20160930/海面漁業マップ_漁船・養殖面積等分析_市区町村.csv'
'seafishing-fishermen_20160930/海面漁業マップ_海面漁業者分析_市区町村.csv'
'tourism-foreigners_20160826/外国人訪問分析_四半期.csv'
8
3
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
8
3