質問編集履歴
4
ファイル先を変更しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,7 +112,7 @@
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
-
m.save('/content/gdrive/MyDrive/
|
115
|
+
m.save('/content/gdrive/MyDrive/data/fukushima.html')
|
116
116
|
|
117
117
|
```
|
118
118
|
|
3
csvの冒頭部分を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -149,5 +149,3 @@
|
|
149
149
|
白河市,"29,690",286,"29,976","29,760",374,"30,134","59,450",660,"60,110","24,515",377,180,"25,072",72052
|
150
150
|
|
151
151
|
須賀川市,"37,175",201,"37,376","38,252",264,"38,516","75,427",465,"75,892","29,442",300,93,"29,835",72079
|
152
|
-
|
153
|
-
ここにより詳細な情報を記載してください。
|
2
質問を受けてデータの取得先やcsvの冒頭部分等を補足しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -49,6 +49,10 @@
|
|
49
49
|
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
|
50
50
|
|
51
51
|
### 該当のソースコード
|
52
|
+
|
53
|
+
```Python
|
54
|
+
|
55
|
+
|
52
56
|
|
53
57
|
!pip install folium==0.8.3
|
54
58
|
|
@@ -110,6 +114,8 @@
|
|
110
114
|
|
111
115
|
m.save('/content/gdrive/MyDrive/安宅研/data/fukushima.html')
|
112
116
|
|
117
|
+
```
|
118
|
+
|
113
119
|
|
114
120
|
|
115
121
|
### 試したこと
|
@@ -120,6 +126,28 @@
|
|
120
126
|
|
121
127
|
### 補足情報(FW/ツールのバージョンなど)
|
122
128
|
|
129
|
+
fukushima_population.csvはhttps://www.pref.fukushima.lg.jp/sec/01145a/juukijinkou.html
|
130
|
+
|
131
|
+
fukushima.geojsonはhttps://nlftp.mlit.go.jp/ksj/index.html
|
132
|
+
|
133
|
+
市区町村コードはhttps://www.soumu.go.jp/denshijiti/code.htmlから取得しました。市区町村コードはcsvファイルに直接入れました。
|
123
134
|
|
124
135
|
|
136
|
+
|
137
|
+
csvの中身
|
138
|
+
|
139
|
+
市町村別人口、世帯数(令和3年1月1日現在),男日本人,男外国人,男合計,女日本人,女外国人,女合計,日本人合計,外国人合計,合計,日本人世帯数,外国人世帯,複数国籍世帯,世帯合計,行政団体コード
|
140
|
+
|
141
|
+
福島市,"133,371",791,"134,162","140,344","1,140","141,484","273,715","1,931","275,646","122,223","1,041",614,"123,878",72010
|
142
|
+
|
143
|
+
会津若松市,"55,586",370,"55,956","60,580",491,"61,071","116,166",861,"117,027","51,325",491,214,"52,030",72028
|
144
|
+
|
145
|
+
郡山市,"156,389","1,338","157,727","162,048","1,619","163,667","318,437","2,957","321,394","140,387","1,852",658,"142,897",72036
|
146
|
+
|
147
|
+
いわき市,"155,409","1,352","156,761","160,188","1,541","161,729","315,597","2,893","318,490","144,235","1,863",695,"146,793",72044
|
148
|
+
|
149
|
+
白河市,"29,690",286,"29,976","29,760",374,"30,134","59,450",660,"60,110","24,515",377,180,"25,072",72052
|
150
|
+
|
151
|
+
須賀川市,"37,175",201,"37,376","38,252",264,"38,516","75,427",465,"75,892","29,442",300,93,"29,835",72079
|
152
|
+
|
125
153
|
ここにより詳細な情報を記載してください。
|
1
コードの内容をすべて記載しました。よろしくお願いします。
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,11 +50,41 @@
|
|
50
50
|
|
51
51
|
### 該当のソースコード
|
52
52
|
|
53
|
+
!pip install folium==0.8.3
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
fukushima_location = [37.750299, 140.467551]
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
import pandas as pd
|
62
|
+
|
63
|
+
fukushima_data = pd.read_csv('/content/gdrive/MyDrive/data/fukushima_population.csv', encoding='utf-8')
|
64
|
+
|
65
|
+
fukushima_data.head()
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
fukushima_data['行政区分コード'] = fukushima_data['行政団体コード'].astype('str')
|
70
|
+
|
71
|
+
fukushima_data['行政区分コード'] = fukushima_data['行政区分コード'].str[:4]
|
72
|
+
|
73
|
+
fukushima_data['行政区分コード'] = fukushima_data['行政区分コード'].str.zfill(5)
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
geojson = '/content/gdrive/MyDrive/data/fukushima.geojson'
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
!pip install folium
|
82
|
+
|
83
|
+
import folium
|
84
|
+
|
53
85
|
|
54
86
|
|
55
87
|
m = folium.Map(location=fukushima_location,tiles='cartodbpositron',zoom_start=10)
|
56
|
-
|
57
|
-
|
58
88
|
|
59
89
|
folium.Choropleth(
|
60
90
|
|