データの地図上での表示

都道府県庁の座標データ

Windows Copilotに以下のようにお願いして作ってもらいました。

「日本のすべての都道府県の都道府県庁の緯度経度と人口のpythonリストを作成してください」

最初の成果です。よさそうな感じがしますが、よく見てみると、どうも都道府県庁が所在している市の人口を示しているようです。

locations = [
    {"prefecture": "北海道", "city": "札幌市", "latitude": 43.064310, "longitude": 141.346879, "population": 1952356},
    {"prefecture": "青森県", "city": "青森市", "latitude": 40.824589, "longitude": 140.740548, "population": 276567},
    {"prefecture": "岩手県", "city": "盛岡市", "latitude": 39.703526, "longitude": 141.152696, "population": 290553},
    {"prefecture": "宮城県", "city": "仙台市", "latitude": 38.268579, "longitude": 140.872072, "population": 1083031},
    {"prefecture": "秋田県", "city": "秋田市", "latitude": 39.718626, "longitude": 140.102381, "population": 309338},
    {"prefecture": "山形県", "city": "山形市", "latitude": 38.240434, "longitude": 140.363690, "population": 248087},
    {"prefecture": "福島県", "city": "福島市", "latitude": 37.750029, "longitude": 140.467771, "population": 283742},
    {"prefecture": "茨城県", "city": "水戸市", "latitude": 36.341737, "longitude": 140.446824, "population": 269330},
    {"prefecture": "栃木県", "city": "宇都宮市", "latitude": 36.565912, "longitude": 139.883592, "population": 519223},
    {"prefecture": "群馬県", "city": "前橋市", "latitude": 36.390688, "longitude": 139.060453, "population": 334936},
    {"prefecture": "埼玉県", "city": "さいたま市", "latitude": 35.857033, "longitude": 139.649012, "population": 1339564},
    {"prefecture": "千葉県", "city": "千葉市", "latitude": 35.604560, "longitude": 140.123154, "population": 979768},
    {"prefecture": "東京都", "city": "新宿区", "latitude": 35.689501, "longitude": 139.691722, "population": 346000},
    {"prefecture": "神奈川県", "city": "横浜市", "latitude": 35.447734, "longitude": 139.642537, "population": 3775000},
    {"prefecture": "新潟県", "city": "新潟市", "latitude": 37.902451, "longitude": 139.023245, "population": 797591},
    {"prefecture": "富山県", "city": "富山市", "latitude": 36.695265, "longitude": 137.211305, "population": 413595},
    {"prefecture": "石川県", "city": "金沢市", "latitude": 36.594606, "longitude": 136.625669, "population": 462478},
    {"prefecture": "福井県", "city": "福井市", "latitude": 36.065209, "longitude": 136.221720, "population": 265011},
    {"prefecture": "山梨県", "city": "甲府市", "latitude": 35.664108, "longitude": 138.568455, "population": 187085},
    {"prefecture": "長野県", "city": "長野市", "latitude": 36.651306, "longitude": 138.180904, "population": 376611},
    {"prefecture": "岐阜県", "city": "岐阜市", "latitude": 35.391174, "longitude": 136.723657, "population": 401534},
    {"prefecture": "静岡県", "city": "静岡市", "latitude": 34.976944, "longitude": 138.383056, "population": 690881},
    {"prefecture": "愛知県", "city": "名古屋市", "latitude": 35.180209, "longitude": 136.906582, "population": 2320000},
    {"prefecture": "三重県", "city": "津市", "latitude": 34.730278, "longitude": 136.508611, "population": 279304},
    {"prefecture": "滋賀県", "city": "大津市", "latitude": 35.004513, "longitude": 135.868568, "population": 341187},
    {"prefecture": "京都府", "city": "京都市", "latitude": 35.021242, "longitude": 135.755613, "population": 1465000},
    {"prefecture": "大阪府", "city": "大阪市", "latitude": 34.686344, "longitude": 135.520037, "population": 2750000},
    {"prefecture": "兵庫県", "city": "神戸市", "latitude": 34.691257, "longitude": 135.183078, "population": 1537000},
    {"prefecture": "奈良県", "city": "奈良市", "latitude": 34.685274, "longitude": 135.832861, "population": 359666},
    {"prefecture": "和歌山県", "city": "和歌山市", "latitude": 34.226111, "longitude": 135.167500, "population": 351391},
    {"prefecture": "鳥取県", "city": "鳥取市", "latitude": 35.503449, "longitude": 134.238261, "population": 192912},
    {"prefecture": "島根県", "city": "松江市", "latitude": 35.472297, "longitude": 133.050499, "population": 203504},
    {"prefecture": "岡山県", "city": "岡山市", "latitude": 34.661759, "longitude": 133.934399, "population": 720841},
    {"prefecture": "広島県", "city": "広島市", "latitude": 34.385203, "longitude": 132.455293, "population": 1194000},
    {"prefecture": "山口県", "city": "山口市", "latitude": 34.185956, "longitude": 131.471389, "population": 193000},
    {"prefecture": "徳島県", "city": "徳島市", "latitude": 34.065761, "longitude": 134.559297, "population": 255439},
    {"prefecture": "香川県", "city": "高松市", "latitude": 34.340149, "longitude": 134.043444, "population": 419429},
    {"prefecture": "愛媛県", "city": "松山市", "latitude": 33.839157, "longitude": 132.765575, "population": 509835},
    {"prefecture": "高知県", "city": "高知市", "latitude": 33.559706, "longitude": 133.531079, "population": 332060},
    {"prefecture": "福岡県", "city": "福岡市", "latitude": 33.606785, "longitude": 130.418314, "population": 1615000},
    {"prefecture": "佐賀県", "city": "佐賀市", "latitude": 33.249367, "longitude": 130.298822, "population": 232736},
    {"prefecture": "長崎県", "city": "長崎市", "latitude": 32.750286, "longitude": 129.877667, "population": 407624},
    {"prefecture": "熊本県", "city": "熊本市", "latitude": 32.803100, "longitude": 130.707891, "population": 738907},
    {"prefecture": "大分県", "city": "大分市", "latitude": 33.238172, "longitude": 131.612619, "population": 477303},
    {"prefecture": "宮崎県", "city": "宮崎市", "latitude": 31.907707, "longitude": 131.420241, "population": 398215},
    {"prefecture": "鹿児島県", "city": "鹿児島市", "latitude": 31.560148, "longitude": 130.557981, "population": 595049},
    {"prefecture": "沖縄県", "city": "那覇市", "latitude": 26.212500, "longitude": 127.681111, "population": 319435}
]

指示を以下のように明確化してもう一度リストを作ってもらいました。

「日本のすべての都道府県ごとに都道府県庁の緯度経度とその都道府県の人口を記載したpythonリストを作成してください」

今度は大丈夫の様です。細かい検証はしていないけど。

都道府県県庁所在地の座標のおおよその真偽は、実際に地図上に表示して見るとおおよその確認は取れますね。

手で作ろうとすると気がめいりますが、一瞬で作ってくれるのですごいですね。

prefectures = [
    {"name": "北海道", "latitude": 43.06417, "longitude": 141.34694, "population": 5224614},
    {"name": "青森県", "latitude": 40.82444, "longitude": 140.74, "population": 1227157},
    {"name": "岩手県", "latitude": 39.70361, "longitude": 141.1525, "population": 1229407},
    {"name": "宮城県", "latitude": 38.26889, "longitude": 140.87194, "population": 2303169},
    {"name": "秋田県", "latitude": 39.71861, "longitude": 140.1025, "population": 959502},
    {"name": "山形県", "latitude": 38.24056, "longitude": 140.36333, "population": 1066328},
    {"name": "福島県", "latitude": 37.75, "longitude": 140.46778, "population": 1833152},
    {"name": "茨城県", "latitude": 36.34139, "longitude": 140.44667, "population": 2866145},
    {"name": "栃木県", "latitude": 36.56583, "longitude": 139.88361, "population": 1933146},
    {"name": "群馬県", "latitude": 36.39111, "longitude": 139.06083, "population": 1921525},
    {"name": "埼玉県", "latitude": 35.85694, "longitude": 139.64889, "population": 7337330},
    {"name": "千葉県", "latitude": 35.60472, "longitude": 140.12333, "population": 6279026},
    {"name": "東京都", "latitude": 35.68944, "longitude": 139.69167, "population": 13942856},
    {"name": "神奈川県", "latitude": 35.44778, "longitude": 139.6425, "population": 9200166},
    {"name": "新潟県", "latitude": 37.90222, "longitude": 139.02361, "population": 2225076},
    {"name": "富山県", "latitude": 36.69528, "longitude": 137.21139, "population": 1042139},
    {"name": "石川県", "latitude": 36.59444, "longitude": 136.62556, "population": 1137180},
    {"name": "福井県", "latitude": 36.06528, "longitude": 136.22194, "population": 778943},
    {"name": "山梨県", "latitude": 35.66389, "longitude": 138.56833, "population": 817192},
    {"name": "長野県", "latitude": 36.65139, "longitude": 138.18111, "population": 2049106},
    {"name": "岐阜県", "latitude": 35.39111, "longitude": 136.72222, "population": 1984890},
    {"name": "静岡県", "latitude": 34.97694, "longitude": 138.38306, "population": 3639397},
    {"name": "愛知県", "latitude": 35.18028, "longitude": 136.90667, "population": 7552873},
    {"name": "三重県", "latitude": 34.73028, "longitude": 136.50861, "population": 1770193},
    {"name": "滋賀県", "latitude": 35.00444, "longitude": 135.86833, "population": 1412916},
    {"name": "京都府", "latitude": 35.02139, "longitude": 135.75556, "population": 2589787},
    {"name": "大阪府", "latitude": 34.68639, "longitude": 135.52, "population": 8824566},
    {"name": "兵庫県", "latitude": 34.69139, "longitude": 135.18306, "population": 5466790},
    {"name": "奈良県", "latitude": 34.68528, "longitude": 135.83278, "population": 1331086},
    {"name": "和歌山県", "latitude": 34.22611, "longitude": 135.1675, "population": 924933},
    {"name": "鳥取県", "latitude": 35.50361, "longitude": 134.23833, "population": 553407},
    {"name": "島根県", "latitude": 35.47222, "longitude": 133.05056, "population": 674346},
    {"name": "岡山県", "latitude": 34.66167, "longitude": 133.935, "population": 1881068},
    {"name": "広島県", "latitude": 34.39639, "longitude": 132.45944, "population": 2797906},
    {"name": "山口県", "latitude": 34.18583, "longitude": 131.47139, "population": 1349631},
    {"name": "徳島県", "latitude": 34.06583, "longitude": 134.55944, "population": 727977},
    {"name": "香川県", "latitude": 34.34028, "longitude": 134.04333, "population": 956347},
    {"name": "愛媛県", "latitude": 33.84167, "longitude": 132.76611, "population": 1320385},
    {"name": "高知県", "latitude": 33.55972, "longitude": 133.53111, "population": 698029},
    {"name": "福岡県", "latitude": 33.60639, "longitude": 130.41806, "population": 5101556},
    {"name": "佐賀県", "latitude": 33.24944, "longitude": 130.29889, "population": 814711},
    {"name": "長崎県", "latitude": 32.74472, "longitude": 129.87361, "population": 1315633},
    {"name": "熊本県", "latitude": 32.78972, "longitude": 130.74167, "population": 1744410},
    {"name": "大分県", "latitude": 33.23806, "longitude": 131.6125, "population": 1139646},
    {"name": "宮崎県", "latitude": 31.90778, "longitude": 131.42028, "population": 1068327},
    {"name": "鹿児島県", "latitude": 31.56028, "longitude": 130.55806, "population": 1591281},
    {"name": "沖縄県", "latitude": 26.2125, "longitude": 127.68111, "population": 1467480}
]
import folium
import math

prefectures = [
    {"name": "北海道", "latitude": 43.06417, "longitude": 141.34694, "population": 5224614},
    {"name": "青森県", "latitude": 40.82444, "longitude": 140.74, "population": 1227157},
    {"name": "岩手県", "latitude": 39.70361, "longitude": 141.1525, "population": 1229407},
    {"name": "宮城県", "latitude": 38.26889, "longitude": 140.87194, "population": 2303169},
    {"name": "秋田県", "latitude": 39.71861, "longitude": 140.1025, "population": 959502},
    {"name": "山形県", "latitude": 38.24056, "longitude": 140.36333, "population": 1066328},
    {"name": "福島県", "latitude": 37.75, "longitude": 140.46778, "population": 1833152},
    {"name": "茨城県", "latitude": 36.34139, "longitude": 140.44667, "population": 2866145},
    {"name": "栃木県", "latitude": 36.56583, "longitude": 139.88361, "population": 1933146},
    {"name": "群馬県", "latitude": 36.39111, "longitude": 139.06083, "population": 1921525},
    {"name": "埼玉県", "latitude": 35.85694, "longitude": 139.64889, "population": 7337330},
    {"name": "千葉県", "latitude": 35.60472, "longitude": 140.12333, "population": 6279026},
    {"name": "東京都", "latitude": 35.68944, "longitude": 139.69167, "population": 13942856},
    {"name": "神奈川県", "latitude": 35.44778, "longitude": 139.6425, "population": 9200166},
    {"name": "新潟県", "latitude": 37.90222, "longitude": 139.02361, "population": 2225076},
    {"name": "富山県", "latitude": 36.69528, "longitude": 137.21139, "population": 1042139},
    {"name": "石川県", "latitude": 36.59444, "longitude": 136.62556, "population": 1137180},
    {"name": "福井県", "latitude": 36.06528, "longitude": 136.22194, "population": 778943},
    {"name": "山梨県", "latitude": 35.66389, "longitude": 138.56833, "population": 817192},
    {"name": "長野県", "latitude": 36.65139, "longitude": 138.18111, "population": 2049106},
    {"name": "岐阜県", "latitude": 35.39111, "longitude": 136.72222, "population": 1984890},
    {"name": "静岡県", "latitude": 34.97694, "longitude": 138.38306, "population": 3639397},
    {"name": "愛知県", "latitude": 35.18028, "longitude": 136.90667, "population": 7552873},
    {"name": "三重県", "latitude": 34.73028, "longitude": 136.50861, "population": 1770193},
    {"name": "滋賀県", "latitude": 35.00444, "longitude": 135.86833, "population": 1412916},
    {"name": "京都府", "latitude": 35.02139, "longitude": 135.75556, "population": 2589787},
    {"name": "大阪府", "latitude": 34.68639, "longitude": 135.52, "population": 8824566},
    {"name": "兵庫県", "latitude": 34.69139, "longitude": 135.18306, "population": 5466790},
    {"name": "奈良県", "latitude": 34.68528, "longitude": 135.83278, "population": 1331086},
    {"name": "和歌山県", "latitude": 34.22611, "longitude": 135.1675, "population": 924933},
    {"name": "鳥取県", "latitude": 35.50361, "longitude": 134.23833, "population": 553407},
    {"name": "島根県", "latitude": 35.47222, "longitude": 133.05056, "population": 674346},
    {"name": "岡山県", "latitude": 34.66167, "longitude": 133.935, "population": 1881068},
    {"name": "広島県", "latitude": 34.39639, "longitude": 132.45944, "population": 2797906},
    {"name": "山口県", "latitude": 34.18583, "longitude": 131.47139, "population": 1349631},
    {"name": "徳島県", "latitude": 34.06583, "longitude": 134.55944, "population": 727977},
    {"name": "香川県", "latitude": 34.34028, "longitude": 134.04333, "population": 956347},
    {"name": "愛媛県", "latitude": 33.84167, "longitude": 132.76611, "population": 1320385},
    {"name": "高知県", "latitude": 33.55972, "longitude": 133.53111, "population": 698029},
    {"name": "福岡県", "latitude": 33.60639, "longitude": 130.41806, "population": 5101556},
    {"name": "佐賀県", "latitude": 33.24944, "longitude": 130.29889, "population": 814711},
    {"name": "長崎県", "latitude": 32.74472, "longitude": 129.87361, "population": 1315633},
    {"name": "熊本県", "latitude": 32.78972, "longitude": 130.74167, "population": 1744410},
    {"name": "大分県", "latitude": 33.23806, "longitude": 131.6125, "population": 1139646},
    {"name": "宮崎県", "latitude": 31.90778, "longitude": 131.42028, "population": 1068327},
    {"name": "鹿児島県", "latitude": 31.56028, "longitude": 130.55806, "population": 1591281},
    {"name": "沖縄県", "latitude": 26.2125, "longitude": 127.68111, "population": 1467480}
]

# 地図の生成(日本全体が表示されるように設定)
m = folium.Map(location=[39,138], zoom_start=5)

# データの可視化
for pref in prefectures :
    folium.CircleMarker(
        [pref['latitude'],pref['longitude']],
        radius=math.sqrt(pref['population']) / 50,  # 人口を面積に反映(適当なスケールに調整)
        color='red',
        fill=True,
        fill_color='blue',
        popup=f'{pref["name"]}: {pref["population"]}'
    ).add_to(m)

# 地図の表示
m

「政令指定都市の座標と人口を示すPythonリストを作成してください。」

cities = [
    {"name": "横浜市", "latitude": 35.4437, "longitude": 139.6380, "population": 3771766},
    {"name": "大阪市", "latitude": 34.6937, "longitude": 135.5023, "population": 2770520},
    {"name": "名古屋市", "latitude": 35.1815, "longitude": 136.9066, "population": 2326683},
    {"name": "札幌市", "latitude": 43.0618, "longitude": 141.3545, "population": 1969918},
    {"name": "福岡市", "latitude": 33.5904, "longitude": 130.4017, "population": 1642571},
    {"name": "川崎市", "latitude": 35.5308, "longitude": 139.7031, "population": 1545604},
    {"name": "神戸市", "latitude": 34.6901, "longitude": 135.1955, "population": 1499887},
    {"name": "京都市", "latitude": 35.0116, "longitude": 135.7681, "population": 1443486},
    {"name": "さいたま市", "latitude": 35.8617, "longitude": 139.6455, "population": 1344850},
    {"name": "広島市", "latitude": 34.3853, "longitude": 132.4553, "population": 1185505},
    {"name": "仙台市", "latitude": 38.2682, "longitude": 140.8694, "population": 1097814},
    {"name": "千葉市", "latitude": 35.6073, "longitude": 140.1063, "population": 979532},
    {"name": "北九州市", "latitude": 33.8833, "longitude": 130.8753, "population": 916241},
    {"name": "堺市", "latitude": 34.5733, "longitude": 135.4828, "population": 812027},
    {"name": "浜松市", "latitude": 34.7108, "longitude": 137.7261, "population": 779780},
    {"name": "新潟市", "latitude": 37.9162, "longitude": 139.0364, "population": 772388},
    {"name": "熊本市", "latitude": 32.8031, "longitude": 130.7079, "population": 738020},
    {"name": "相模原市", "latitude": 35.5533, "longitude": 139.3545, "population": 725087},
    {"name": "岡山市", "latitude": 34.6551, "longitude": 133.9195, "population": 715740},
    {"name": "静岡市", "latitude": 34.9756, "longitude": 138.3828, "population": 677286}
]
# 政令指定都市の位置と人口
import folium
import math

cities = [
    {"name": "横浜市", "latitude": 35.4437, "longitude": 139.6380, "population": 3771766},
    {"name": "大阪市", "latitude": 34.6937, "longitude": 135.5023, "population": 2770520},
    {"name": "名古屋市", "latitude": 35.1815, "longitude": 136.9066, "population": 2326683},
    {"name": "札幌市", "latitude": 43.0618, "longitude": 141.3545, "population": 1969918},
    {"name": "福岡市", "latitude": 33.5904, "longitude": 130.4017, "population": 1642571},
    {"name": "川崎市", "latitude": 35.5308, "longitude": 139.7031, "population": 1545604},
    {"name": "神戸市", "latitude": 34.6901, "longitude": 135.1955, "population": 1499887},
    {"name": "京都市", "latitude": 35.0116, "longitude": 135.7681, "population": 1443486},
    {"name": "さいたま市", "latitude": 35.8617, "longitude": 139.6455, "population": 1344850},
    {"name": "広島市", "latitude": 34.3853, "longitude": 132.4553, "population": 1185505},
    {"name": "仙台市", "latitude": 38.2682, "longitude": 140.8694, "population": 1097814},
    {"name": "千葉市", "latitude": 35.6073, "longitude": 140.1063, "population": 979532},
    {"name": "北九州市", "latitude": 33.8833, "longitude": 130.8753, "population": 916241},
    {"name": "堺市", "latitude": 34.5733, "longitude": 135.4828, "population": 812027},
    {"name": "浜松市", "latitude": 34.7108, "longitude": 137.7261, "population": 779780},
    {"name": "新潟市", "latitude": 37.9162, "longitude": 139.0364, "population": 772388},
    {"name": "熊本市", "latitude": 32.8031, "longitude": 130.7079, "population": 738020},
    {"name": "相模原市", "latitude": 35.5533, "longitude": 139.3545, "population": 725087},
    {"name": "岡山市", "latitude": 34.6551, "longitude": 133.9195, "population": 715740},
    {"name": "静岡市", "latitude": 34.9756, "longitude": 138.3828, "population": 677286}
]

# 地図の生成(日本全体が表示されるように設定)
m = folium.Map(location=[39,138], zoom_start=6)

# データの可視化
for city in cities:
    folium.CircleMarker(
        [city['latitude'], city['longitude']],
        radius=math.sqrt(city['population']) / 30,  # 人口を面積に反映(適当なスケールに調整)
        color='red',
        fill=True,
        fill_color='blue',
        popup=f'{city["name"]}: {city["population"]}'
    ).add_to(m)

# 地図の表示
m
tokyo_23_wards = [
    {"name": "千代田区", "latitude": 35.6938, "longitude": 139.7536, "population": 66687},
    {"name": "中央区", "latitude": 35.6702, "longitude": 139.7720, "population": 170475},
    {"name": "港区", "latitude": 35.6581, "longitude": 139.7516, "population": 257776},
    {"name": "新宿区", "latitude": 35.6938, "longitude": 139.7036, "population": 346028},
    {"name": "文京区", "latitude": 35.7081, "longitude": 139.7528, "population": 239624},
    {"name": "台東区", "latitude": 35.7126, "longitude": 139.7800, "population": 212032},
    {"name": "墨田区", "latitude": 35.7100, "longitude": 139.8016, "population": 272158},
    {"name": "江東区", "latitude": 35.6735, "longitude": 139.8174, "population": 523631},
    {"name": "品川区", "latitude": 35.6092, "longitude": 139.7300, "population": 418658},
    {"name": "目黒区", "latitude": 35.6411, "longitude": 139.6984, "population": 284282},
    {"name": "大田区", "latitude": 35.5614, "longitude": 139.7160, "population": 740312},
    {"name": "世田谷区", "latitude": 35.6467, "longitude": 139.6532, "population": 937615},
    {"name": "渋谷区", "latitude": 35.6640, "longitude": 139.6982, "population": 241998},
    {"name": "中野区", "latitude": 35.7074, "longitude": 139.6638, "population": 341843},
    {"name": "杉並区", "latitude": 35.6993, "longitude": 139.6368, "population": 586102},
    {"name": "豊島区", "latitude": 35.7323, "longitude": 139.7150, "population": 297751},
    {"name": "北区", "latitude": 35.7520, "longitude": 139.7331, "population": 352925},
    {"name": "荒川区", "latitude": 35.7331, "longitude": 139.7830, "population": 216588},
    {"name": "板橋区", "latitude": 35.7512, "longitude": 139.7101, "population": 580746},
    {"name": "練馬区", "latitude": 35.7356, "longitude": 139.6527, "population": 750075},
    {"name": "足立区", "latitude": 35.7746, "longitude": 139.8044, "population": 692322},
    {"name": "葛飾区", "latitude": 35.7433, "longitude": 139.8477, "population": 450868},
    {"name": "江戸川区", "latitude": 35.7064, "longitude": 139.8680, "population": 690645}
]
import folium
import math

tokyo_23_wards = [
    {"name": "千代田区", "latitude": 35.6938, "longitude": 139.7536, "population": 66687},
    {"name": "中央区", "latitude": 35.6702, "longitude": 139.7720, "population": 170475},
    {"name": "港区", "latitude": 35.6581, "longitude": 139.7516, "population": 257776},
    {"name": "新宿区", "latitude": 35.6938, "longitude": 139.7036, "population": 346028},
    {"name": "文京区", "latitude": 35.7081, "longitude": 139.7528, "population": 239624},
    {"name": "台東区", "latitude": 35.7126, "longitude": 139.7800, "population": 212032},
    {"name": "墨田区", "latitude": 35.7100, "longitude": 139.8016, "population": 272158},
    {"name": "江東区", "latitude": 35.6735, "longitude": 139.8174, "population": 523631},
    {"name": "品川区", "latitude": 35.6092, "longitude": 139.7300, "population": 418658},
    {"name": "目黒区", "latitude": 35.6411, "longitude": 139.6984, "population": 284282},
    {"name": "大田区", "latitude": 35.5614, "longitude": 139.7160, "population": 740312},
    {"name": "世田谷区", "latitude": 35.6467, "longitude": 139.6532, "population": 937615},
    {"name": "渋谷区", "latitude": 35.6640, "longitude": 139.6982, "population": 241998},
    {"name": "中野区", "latitude": 35.7074, "longitude": 139.6638, "population": 341843},
    {"name": "杉並区", "latitude": 35.6993, "longitude": 139.6368, "population": 586102},
    {"name": "豊島区", "latitude": 35.7323, "longitude": 139.7150, "population": 297751},
    {"name": "北区", "latitude": 35.7520, "longitude": 139.7331, "population": 352925},
    {"name": "荒川区", "latitude": 35.7331, "longitude": 139.7830, "population": 216588},
    {"name": "板橋区", "latitude": 35.7512, "longitude": 139.7101, "population": 580746},
    {"name": "練馬区", "latitude": 35.7356, "longitude": 139.6527, "population": 750075},
    {"name": "足立区", "latitude": 35.7746, "longitude": 139.8044, "population": 692322},
    {"name": "葛飾区", "latitude": 35.7433, "longitude": 139.8477, "population": 450868},
    {"name": "江戸川区", "latitude": 35.7064, "longitude": 139.8680, "population": 690645}
]

# 地図の生成(東京都区部全体が(だいたい)表示されるように設定)
m = folium.Map(location=[35.6702,139.7720], zoom_start=12)

# データの可視化
for wards in tokyo_23_wards:
    folium.CircleMarker(
        [wards['latitude'],wards['longitude']],
        radius=math.sqrt(wards['population']) / 10,  # 人口を面積に反映(適当なスケールに調整)
        color='red',
        fill=True,
        fill_color='blue',
        popup=f'{wards["name"]}: {wards["population"]}'
    ).add_to(m)

# 地図の表示
m

大阪府の市町村の座標と人口を示すPythonリストを作成してください

osaka_data = [
    {"name": "大阪市", "latitude": 34.6937, "longitude": 135.5023, "population": 2790453},
    {"name": "堺市", "latitude": 34.5733, "longitude": 135.4828, "population": 807868},
    {"name": "東大阪市", "latitude": 34.6794, "longitude": 135.6008, "population": 485405},
    {"name": "豊中市", "latitude": 34.7825, "longitude": 135.4691, "population": 398233},
    {"name": "吹田市", "latitude": 34.7614, "longitude": 135.5157, "population": 393464},
    {"name": "枚方市", "latitude": 34.8148, "longitude": 135.6503, "population": 389861},
    {"name": "高槻市", "latitude": 34.8480, "longitude": 135.6176, "population": 347766},
    {"name": "茨木市", "latitude": 34.8160, "longitude": 135.5683, "population": 290406},
    {"name": "八尾市", "latitude": 34.6266, "longitude": 135.6008, "population": 258999},
    {"name": "寝屋川市", "latitude": 34.7648, "longitude": 135.6283, "population": 223790},
    # 他の市町村のデータも同様に追加できます
]

print(osaka_data)

大阪府のすべての市町村の座標と人口を示すPythonリストを作成してください

import folium
import math

osaka_data = [
    {"name": "大阪市", "latitude": 34.6937, "longitude": 135.5023, "population": 2790453},
    {"name": "堺市", "latitude": 34.5733, "longitude": 135.4828, "population": 807868},
    {"name": "岸和田市", "latitude": 34.4580, "longitude": 135.3725, "population": 192991},
    {"name": "豊中市", "latitude": 34.7825, "longitude": 135.4691, "population": 398233},
    {"name": "池田市", "latitude": 34.8224, "longitude": 135.4283, "population": 103643},
    {"name": "吹田市", "latitude": 34.7614, "longitude": 135.5157, "population": 393464},
    {"name": "泉大津市", "latitude": 34.5015, "longitude": 135.4042, "population": 73862},
    {"name": "高槻市", "latitude": 34.8480, "longitude": 135.6176, "population": 347766},
    {"name": "貝塚市", "latitude": 34.4378, "longitude": 135.3570, "population": 87062},
    {"name": "守口市", "latitude": 34.7358, "longitude": 135.5612, "population": 143579},
    {"name": "枚方市", "latitude": 34.8148, "longitude": 135.6503, "population": 389861},
    {"name": "茨木市", "latitude": 34.8160, "longitude": 135.5683, "population": 290406},
    {"name": "八尾市", "latitude": 34.6266, "longitude": 135.6008, "population": 258999},
    {"name": "泉佐野市", "latitude": 34.4063, "longitude": 135.3151, "population": 101444},
    {"name": "富田林市", "latitude": 34.5000, "longitude": 135.5975, "population": 108458},
    {"name": "寝屋川市", "latitude": 34.7648, "longitude": 135.6283, "population": 223790},
    {"name": "河内長野市", "latitude": 34.4647, "longitude": 135.5612, "population": 105940},
    {"name": "松原市", "latitude": 34.5794, "longitude": 135.5500, "population": 119962},
    {"name": "大東市", "latitude": 34.7139, "longitude": 135.6208, "population": 121965},
    {"name": "和泉市", "latitude": 34.4833, "longitude": 135.4208, "population": 186370},
    {"name": "箕面市", "latitude": 34.8264, "longitude": 135.4700, "population": 135620},
    {"name": "柏原市", "latitude": 34.5833, "longitude": 135.6167, "population": 71522},
    {"name": "羽曳野市", "latitude": 34.5667, "longitude": 135.6000, "population": 111622},
    {"name": "門真市", "latitude": 34.7381, "longitude": 135.5800, "population": 120841},
    {"name": "摂津市", "latitude": 34.7667, "longitude": 135.5500, "population": 85585},
    {"name": "高石市", "latitude": 34.5333, "longitude": 135.4333, "population": 55845},
    {"name": "藤井寺市", "latitude": 34.5667, "longitude": 135.6000, "population": 65489},
    {"name": "東大阪市", "latitude": 34.6794, "longitude": 135.6008, "population": 485405},
    {"name": "泉南市", "latitude": 34.3500, "longitude": 135.2667, "population": 61792},
    {"name": "四條畷市", "latitude": 34.7333, "longitude": 135.6500, "population": 56317},
    {"name": "交野市", "latitude": 34.8000, "longitude": 135.6833, "population": 76442},
    {"name": "大阪狭山市", "latitude": 34.5000, "longitude": 135.5667, "population": 58245},
    {"name": "阪南市", "latitude": 34.3500, "longitude": 135.2333, "population": 53815},
    {"name": "島本町", "latitude": 34.9000, "longitude": 135.6333, "population": 31255},
    {"name": "豊能町", "latitude": 34.9000, "longitude": 135.5167, "population": 19645},
    {"name": "能勢町", "latitude": 34.9500, "longitude": 135.4167, "population": 9500},
    {"name": "忠岡町", "latitude": 34.5000, "longitude": 135.4000, "population": 17745},
    {"name": "熊取町", "latitude": 34.4167, "longitude": 135.3500, "population": 44000},
    {"name": "田尻町", "latitude": 34.3833, "longitude": 135.2667, "population": 8500},
    {"name": "岬町", "latitude": 34.3167, "longitude": 135.2000, "population": 17000},
    {"name": "太子町", "latitude": 34.5333, "longitude": 135.6167, "population": 14000},
    {"name": "河南町", "latitude": 34.5000, "longitude": 135.6167, "population": 16000},
    {"name": "千早赤阪村", "latitude": 34.5000, "longitude": 135.6500, "population": 5000}
]

# 地図の生成(大阪全体が(だいたい)表示されるように設定)
m = folium.Map(location=[34.6,135.5], zoom_start=11)

# データの可視化
for city in osaka_data:
    folium.CircleMarker(
        [city['latitude'], city['longitude']],
        radius=math.sqrt(city['population']) / 10,  # 人口を面積に反映(適当なスケールに調整)
        color='red',
        fill=True,
        fill_color='blue',
        popup=f'{city["name"]}: {city["population"]}'
    ).add_to(m)

# 地図の表示
m

「大阪市のすべての区の人口と座標を記載したpythonリストを作成して」

ちょっと学習したのか、質問が日本語で続いているので、リストのキーが日本語に!

座標の表現法も変わってますね。

# 大阪市の各区の人口と座標データ
osaka_wards = [
    {"区": "北区", "人口": 140706, "座標": (34.7055, 135.5118)},
    {"区": "都島区", "人口": 107838, "座標": (34.7025, 135.5322)},
    {"区": "福島区", "人口": 79844, "座標": (34.6937, 135.4860)},
    {"区": "此花区", "人口": 64764, "座標": (34.6824, 135.4536)},
    {"区": "中央区", "人口": 107004, "座標": (34.6863, 135.5197)},
    {"区": "西区", "人口": 106917, "座標": (34.6764, 135.4910)},
    {"区": "港区", "人口": 79978, "座標": (34.6574, 135.4592)},
    {"区": "大正区", "人口": 61356, "座標": (34.6500, 135.4711)},
    {"区": "天王寺区", "人口": 83087, "座標": (34.6545, 135.5167)},
    {"区": "浪速区", "人口": 76863, "座標": (34.6643, 135.5012)},
    {"区": "西淀川区", "人口": 95572, "座標": (34.7163, 135.4674)},
    {"区": "淀川区", "人口": 183450, "座標": (34.7184, 135.4910)},
    {"区": "東淀川区", "人口": 176039, "座標": (34.7335, 135.5322)},
    {"区": "東成区", "人口": 85175, "座標": (34.6667, 135.5372)},
    {"区": "生野区", "人口": 126664, "座標": (34.6533, 135.5444)},
    {"区": "旭区", "人口": 89208, "座標": (34.7184, 135.5444)},
    {"区": "城東区", "人口": 168762, "座標": (34.6961, 135.5533)},
    {"区": "鶴見区", "人口": 112219, "座標": (34.7000, 135.5700)},
    {"区": "阿倍野区", "人口": 111296, "座標": (34.6450, 135.5167)},
    {"区": "住之江区", "人口": 118732, "座標": (34.6050, 135.4944)},
    {"区": "住吉区", "人口": 152472, "座標": (34.6167, 135.5167)},
    {"区": "東住吉区", "人口": 127277, "座標": (34.6167, 135.5333)},
    {"区": "平野区", "人口": 190166, "座標": (34.6167, 135.5500)},
    {"区": "西成区", "人口": 105446, "座標": (34.6467, 135.4944)}
]

# データの表示
for ward in osaka_wards:
    print(f"{ward['区']}: 人口 {ward['人口']}人, 座標 {ward['座標']}")
import folium
import math

# 大阪市の各区の人口と座標データ
osaka_wards = [
    {"区": "北区", "人口": 140706, "座標": (34.7055, 135.5118)},
    {"区": "都島区", "人口": 107838, "座標": (34.7025, 135.5322)},
    {"区": "福島区", "人口": 79844, "座標": (34.6937, 135.4860)},
    {"区": "此花区", "人口": 64764, "座標": (34.6824, 135.4536)},
    {"区": "中央区", "人口": 107004, "座標": (34.6863, 135.5197)},
    {"区": "西区", "人口": 106917, "座標": (34.6764, 135.4910)},
    {"区": "港区", "人口": 79978, "座標": (34.6574, 135.4592)},
    {"区": "大正区", "人口": 61356, "座標": (34.6500, 135.4711)},
    {"区": "天王寺区", "人口": 83087, "座標": (34.6545, 135.5167)},
    {"区": "浪速区", "人口": 76863, "座標": (34.6643, 135.5012)},
    {"区": "西淀川区", "人口": 95572, "座標": (34.7163, 135.4674)},
    {"区": "淀川区", "人口": 183450, "座標": (34.7184, 135.4910)},
    {"区": "東淀川区", "人口": 176039, "座標": (34.7335, 135.5322)},
    {"区": "東成区", "人口": 85175, "座標": (34.6667, 135.5372)},
    {"区": "生野区", "人口": 126664, "座標": (34.6533, 135.5444)},
    {"区": "旭区", "人口": 89208, "座標": (34.7184, 135.5444)},
    {"区": "城東区", "人口": 168762, "座標": (34.6961, 135.5533)},
    {"区": "鶴見区", "人口": 112219, "座標": (34.7000, 135.5700)},
    {"区": "阿倍野区", "人口": 111296, "座標": (34.6450, 135.5167)},
    {"区": "住之江区", "人口": 118732, "座標": (34.6050, 135.4944)},
    {"区": "住吉区", "人口": 152472, "座標": (34.6167, 135.5167)},
    {"区": "東住吉区", "人口": 127277, "座標": (34.6167, 135.5333)},
    {"区": "平野区", "人口": 190166, "座標": (34.6167, 135.5500)},
    {"区": "西成区", "人口": 105446, "座標": (34.6467, 135.4944)}
]

# 地図の生成(大阪全体が(だいたい)表示されるように設定)
m = folium.Map(location=[34.67,135.5], zoom_start=13)

# データの可視化
for ward in osaka_wards:
    folium.CircleMarker(
        [ward['座標'][0], ward['座標'][1]],
        radius=math.sqrt(ward['人口']) / 10,  # 人口を面積に反映(適当なスケールに調整)
        color='red',
        fill=True,
        fill_color='blue',
        popup=f"{ward['区']}: {ward['人口']}"
    ).add_to(m)

# 地図の表示
m

大阪市の1950年からの人口推移のデータをpythonリストで作成して

osaka_population = [
    {"year": 1950, "population": 1956136},
    {"year": 1955, "population": 2547316},
    {"year": 1960, "population": 3011563},
    {"year": 1965, "population": 3156222},
    {"year": 1970, "population": 3018175},
    {"year": 1975, "population": 2778987},
    {"year": 1980, "population": 2631249},
    {"year": 1985, "population": 2631317},
    {"year": 1990, "population": 2623801},
    {"year": 1995, "population": 2602421},
    {"year": 2000, "population": 2598774},
    {"year": 2005, "population": 2628811},
    {"year": 2010, "population": 2665314},
    {"year": 2015, "population": 2701580},
    {"year": 2020, "population": 2750000},  # 推計値
    {"year": 2023, "population": 2790453}   # 推計値
]

大阪市の1950年から毎年の人口推移のデータをpythonリストで作成して

osaka_population = [
    {"year": 1950, "population": 1956136},
    {"year": 1951, "population": 2114539},
    {"year": 1952, "population": 2235913},
    {"year": 1953, "population": 2341019},
    {"year": 1954, "population": 2420541},
    {"year": 1955, "population": 2547316},
    {"year": 1956, "population": 2615713},
    {"year": 1957, "population": 2719039},
    {"year": 1958, "population": 2807619},
    {"year": 1959, "population": 2887318},
    {"year": 1960, "population": 3011563},
    {"year": 1961, "population": 3068478},
    {"year": 1962, "population": 3115439},
    {"year": 1963, "population": 3140670},
    {"year": 1964, "population": 3154371},
    {"year": 1965, "population": 3156222},
    {"year": 1966, "population": 3133084},
    {"year": 1967, "population": 3106085},
    {"year": 1968, "population": 3077751},
    {"year": 1969, "population": 3018175},
    {"year": 1970, "population": 2980487},
    {"year": 1971, "population": 2942404},
    {"year": 1972, "population": 2894509},
    {"year": 1973, "population": 2849102},
    {"year": 1974, "population": 2810322},
    {"year": 1975, "population": 2778987},
    {"year": 1976, "population": 2748781},
    {"year": 1977, "population": 2720651},
    {"year": 1978, "population": 2694091},
    {"year": 1979, "population": 2671163},
    {"year": 1980, "population": 2631249},
    {"year": 1981, "population": 2634911},
    {"year": 1982, "population": 2631317},
    {"year": 1983, "population": 2636249},
    {"year": 1984, "population": 2643780},
    {"year": 1985, "population": 2649758},
    {"year": 1986, "population": 2646399},
    {"year": 1987, "population": 2637434},
    {"year": 1988, "population": 2623801},
    {"year": 1989, "population": 2613199},
    {"year": 1990, "population": 2603272},
    {"year": 1991, "population": 2595584},
    {"year": 1992, "population": 2590270},
    {"year": 1993, "population": 2602421},
    {"year": 1994, "population": 2600058},
    {"year": 1995, "population": 2596502},
    {"year": 1996, "population": 2596276},
    {"year": 1997, "population": 2595155},
    {"year": 1998, "population": 2598774},
    {"year": 1999, "population": 2607054},
    {"year": 2000, "population": 2614868},
    {"year": 2001, "population": 2619930},
    {"year": 2002, "population": 2624747},
    {"year": 2003, "population": 2628811},
    {"year": 2004, "population": 2634944},
    {"year": 2005, "population": 2642854},
    {"year": 2006, "population": 2650670},
    {"year": 2007, "population": 2659796},
    {"year": 2008, "population": 2665314},
    {"year": 2009, "population": 2670579},
    {"year": 2010, "population": 2677375},
    {"year": 2011, "population": 2680000},
    {"year": 2012, "population": 2685000},
    {"year": 2013, "population": 2690000},
    {"year": 2014, "population": 2695000},
    {"year": 2015, "population": 2700000},
    {"year": 2016, "population": 2705000},
    {"year": 2017, "population": 2710000},
    {"year": 2018, "population": 2715000},
    {"year": 2019, "population": 2720000},
    {"year": 2020, "population": 2725000},
    {"year": 2021, "population": 2730000},
    {"year": 2022, "population": 2735000},
    {"year": 2023, "population": 2740000},
    {"year": 2024, "population": 2745000}  # 推計値
]
import numpy as np
import matplotlib.pyplot as plt

osaka_population = [
    {"year": 1950, "population": 1956136},
    {"year": 1951, "population": 2114539},
    {"year": 1952, "population": 2235913},
    {"year": 1953, "population": 2341019},
    {"year": 1954, "population": 2420541},
    {"year": 1955, "population": 2547316},
    {"year": 1956, "population": 2615713},
    {"year": 1957, "population": 2719039},
    {"year": 1958, "population": 2807619},
    {"year": 1959, "population": 2887318},
    {"year": 1960, "population": 3011563},
    {"year": 1961, "population": 3068478},
    {"year": 1962, "population": 3115439},
    {"year": 1963, "population": 3140670},
    {"year": 1964, "population": 3154371},
    {"year": 1965, "population": 3156222},
    {"year": 1966, "population": 3133084},
    {"year": 1967, "population": 3106085},
    {"year": 1968, "population": 3077751},
    {"year": 1969, "population": 3018175},
    {"year": 1970, "population": 2980487},
    {"year": 1971, "population": 2942404},
    {"year": 1972, "population": 2894509},
    {"year": 1973, "population": 2849102},
    {"year": 1974, "population": 2810322},
    {"year": 1975, "population": 2778987},
    {"year": 1976, "population": 2748781},
    {"year": 1977, "population": 2720651},
    {"year": 1978, "population": 2694091},
    {"year": 1979, "population": 2671163},
    {"year": 1980, "population": 2631249},
    {"year": 1981, "population": 2634911},
    {"year": 1982, "population": 2631317},
    {"year": 1983, "population": 2636249},
    {"year": 1984, "population": 2643780},
    {"year": 1985, "population": 2649758},
    {"year": 1986, "population": 2646399},
    {"year": 1987, "population": 2637434},
    {"year": 1988, "population": 2623801},
    {"year": 1989, "population": 2613199},
    {"year": 1990, "population": 2603272},
    {"year": 1991, "population": 2595584},
    {"year": 1992, "population": 2590270},
    {"year": 1993, "population": 2602421},
    {"year": 1994, "population": 2600058},
    {"year": 1995, "population": 2596502},
    {"year": 1996, "population": 2596276},
    {"year": 1997, "population": 2595155},
    {"year": 1998, "population": 2598774},
    {"year": 1999, "population": 2607054},
    {"year": 2000, "population": 2614868},
    {"year": 2001, "population": 2619930},
    {"year": 2002, "population": 2624747},
    {"year": 2003, "population": 2628811},
    {"year": 2004, "population": 2634944},
    {"year": 2005, "population": 2642854},
    {"year": 2006, "population": 2650670},
    {"year": 2007, "population": 2659796},
    {"year": 2008, "population": 2665314},
    {"year": 2009, "population": 2670579},
    {"year": 2010, "population": 2677375},
    {"year": 2011, "population": 2680000},
    {"year": 2012, "population": 2685000},
    {"year": 2013, "population": 2690000},
    {"year": 2014, "population": 2695000},
    {"year": 2015, "population": 2700000},
    {"year": 2016, "population": 2705000},
    {"year": 2017, "population": 2710000},
    {"year": 2018, "population": 2715000},
    {"year": 2019, "population": 2720000},
    {"year": 2020, "population": 2725000},
    {"year": 2021, "population": 2730000},
    {"year": 2022, "population": 2735000},
    {"year": 2023, "population": 2740000},
    {"year": 2024, "population": 2745000}  # 推計値
]

x=[]
y=[]
for data in osaka_population:
    x.append(data["year"])
    y.append(data["population"])

plt.clf()
# step2 グラフフレームの作成
fig, ax = plt.subplots()

# step3 グラフの描画
ax.plot(x, y, linestyle='-')

# step4 軸,凡例,タイトルの設定
ax.set_xlim(1950, 2024)
ax.set_ylim(1500000, 3500000)
ax.set_xlabel('YEAR')
ax.set_ylabel('POPULATION')
ax.grid()
ax.set_title('Osaka City Population Transition')

# step5 Figureの呼び出し
plt

福岡市のすべての区の人口と座標を記載したpythonリストを作成して

# 福岡市の各区の人口と座標データ
fukuoka_wards = [
    {"区": "東区", "人口": 315000, "座標": (33.6340, 130.4413)},
    {"区": "博多区", "人口": 228000, "座標": (33.5902, 130.4206)},
    {"区": "中央区", "人口": 195000, "座標": (33.5833, 130.3925)},
    {"区": "南区", "人口": 255000, "座標": (33.5610, 130.4444)},
    {"区": "西区", "人口": 211000, "座標": (33.5833, 130.3078)},
    {"区": "城南区", "人口": 128000, "座標": (33.5610, 130.3769)},
    {"区": "早良区", "人口": 218000, "座標": (33.5586, 130.3519)}
]

# データの表示
for ward in fukuoka_wards:
    print(f"{ward['区']}: 人口 {ward['人口']}人, 座標 {ward['座標']}")

福岡県のすべての市町村の人口と座標を記載したpythonリストを作成して

# 福岡県の各市町村の人口と座標データ
fukuoka_municipalities = [
    {"市町村": "福岡市", "人口": 1610000, "座標": (33.5902, 130.4017)},
    {"市町村": "北九州市", "人口": 940000, "座標": (33.8833, 130.8756)},
    {"市町村": "久留米市", "人口": 303000, "座標": (33.3192, 130.5081)},
    {"市町村": "飯塚市", "人口": 128000, "座標": (33.6458, 130.6917)},
    {"市町村": "田川市", "人口": 48600, "座標": (33.6361, 130.8069)},
    {"市町村": "柳川市", "人口": 66700, "座標": (33.1631, 130.4094)},
    {"市町村": "八女市", "人口": 64300, "座標": (33.2094, 130.5578)},
    {"市町村": "筑後市", "人口": 48100, "座標": (33.2133, 130.5033)},
    {"市町村": "大牟田市", "人口": 113000, "座標": (33.0333, 130.4500)},
    {"市町村": "行橋市", "人口": 71500, "座標": (33.7283, 130.9833)},
    {"市町村": "豊前市", "人口": 23500, "座標": (33.6111, 131.1278)},
    {"市町村": "中間市", "人口": 41300, "座標": (33.8167, 130.7000)},
    {"市町村": "小郡市", "人口": 60100, "座標": (33.3961, 130.5556)},
    {"市町村": "筑紫野市", "人口": 103000, "座標": (33.4961, 130.5233)},
    {"市町村": "春日市", "人口": 112000, "座標": (33.5350, 130.4700)},
    {"市町村": "大野城市", "人口": 101000, "座標": (33.5350, 130.4783)},
    {"市町村": "宗像市", "人口": 96300, "座標": (33.7961, 130.5333)},
    {"市町村": "太宰府市", "人口": 70700, "座標": (33.5125, 130.5233)},
    {"市町村": "古賀市", "人口": 59800, "座標": (33.7283, 130.4667)},
    {"市町村": "福津市", "人口": 62200, "座標": (33.7667, 130.4833)},
    {"市町村": "うきは市", "人口": 29700, "座標": (33.3450, 130.7500)},
    {"市町村": "宮若市", "人口": 27800, "座標": (33.7333, 130.6167)},
    {"市町村": "嘉麻市", "人口": 37400, "座標": (33.5667, 130.6833)},
    {"市町村": "朝倉市", "人口": 49600, "座標": (33.4211, 130.6650)},
    {"市町村": "みやま市", "人口": 37900, "座標": (33.1500, 130.4500)},
    {"市町村": "糸島市", "人口": 101000, "座標": (33.5583, 130.1950)},
    {"市町村": "那珂川市", "人口": 50700, "座標": (33.5167, 130.4667)}
]

# データの表示
for municipality in fukuoka_municipalities:
    print(f"{municipality['市町村']}: 人口 {municipality['人口']}人, 座標 {municipality['座標']}")

リストに町と村のデータを追加してください

# 福岡県の各市町村の人口と座標データ
fukuoka_municipalities = [
    {"市町村": "福岡市", "人口": 1610000, "座標": (33.5902, 130.4017)},
    {"市町村": "北九州市", "人口": 940000, "座標": (33.8833, 130.8756)},
    {"市町村": "久留米市", "人口": 303000, "座標": (33.3192, 130.5081)},
    {"市町村": "飯塚市", "人口": 128000, "座標": (33.6458, 130.6917)},
    {"市町村": "田川市", "人口": 48600, "座標": (33.6361, 130.8069)},
    {"市町村": "柳川市", "人口": 66700, "座標": (33.1631, 130.4094)},
    {"市町村": "八女市", "人口": 64300, "座標": (33.2094, 130.5578)},
    {"市町村": "筑後市", "人口": 48100, "座標": (33.2133, 130.5033)},
    {"市町村": "大牟田市", "人口": 113000, "座標": (33.0333, 130.4500)},
    {"市町村": "行橋市", "人口": 71500, "座標": (33.7283, 130.9833)},
    {"市町村": "豊前市", "人口": 23500, "座標": (33.6111, 131.1278)},
    {"市町村": "中間市", "人口": 41300, "座標": (33.8167, 130.7000)},
    {"市町村": "小郡市", "人口": 60100, "座標": (33.3961, 130.5556)},
    {"市町村": "筑紫野市", "人口": 103000, "座標": (33.4961, 130.5233)},
    {"市町村": "春日市", "人口": 112000, "座標": (33.5350, 130.4700)},
    {"市町村": "大野城市", "人口": 101000, "座標": (33.5350, 130.4783)},
    {"市町村": "宗像市", "人口": 96300, "座標": (33.7961, 130.5333)},
    {"市町村": "太宰府市", "人口": 70700, "座標": (33.5125, 130.5233)},
    {"市町村": "古賀市", "人口": 59800, "座標": (33.7283, 130.4667)},
    {"市町村": "福津市", "人口": 62200, "座標": (33.7667, 130.4833)},
    {"市町村": "うきは市", "人口": 29700, "座標": (33.3450, 130.7500)},
    {"市町村": "宮若市", "人口": 27800, "座標": (33.7333, 130.6167)},
    {"市町村": "嘉麻市", "人口": 37400, "座標": (33.5667, 130.6833)},
    {"市町村": "朝倉市", "人口": 49600, "座標": (33.4211, 130.6650)},
    {"市町村": "みやま市", "人口": 37900, "座標": (33.1500, 130.4500)},
    {"市町村": "糸島市", "人口": 101000, "座標": (33.5583, 130.1950)},
    {"市町村": "那珂川市", "人口": 50700, "座標": (33.5167, 130.4667)},
    {"市町村": "芦屋町", "人口": 14000, "座標": (33.8833, 130.6500)},
    {"市町村": "水巻町", "人口": 28000, "座標": (33.8667, 130.6833)},
    {"市町村": "岡垣町", "人口": 31000, "座標": (33.8333, 130.6167)},
    {"市町村": "遠賀町", "人口": 19000, "座標": (33.8333, 130.6833)},
    {"市町村": "小竹町", "人口": 7000, "座標": (33.7333, 130.7000)},
    {"市町村": "鞍手町", "人口": 17000, "座標": (33.7833, 130.6667)},
    {"市町村": "桂川町", "人口": 13000, "座標": (33.6167, 130.6833)},
    {"市町村": "筑前町", "人口": 28000, "座標": (33.4667, 130.6667)},
    {"市町村": "東峰村", "人口": 2000, "座標": (33.4667, 130.8667)},
    {"市町村": "大刀洗町", "人口": 15000, "座標": (33.4167, 130.6167)},
    {"市町村": "大木町", "人口": 14000, "座標": (33.2167, 130.4167)},
    {"市町村": "広川町", "人口": 20000, "座標": (33.2167, 130.5167)},
    {"市町村": "香春町", "人口": 11000, "座標": (33.6667, 130.8833)},
    {"市町村": "添田町", "人口": 10000, "座標": (33.5667, 130.8833)},
    {"市町村": "糸田町", "人口": 8000, "座標": (33.6333, 130.8000)},
    {"市町村": "川崎町", "人口": 17000, "座標": (33.6000, 130.8167)},
    {"市町村": "大任町", "人口": 5000, "座標": (33.5833, 130.8667)},
    {"市町村": "赤村", "人口": 3000, "座標": (33.5667, 130.9000)},
    {"市町村": "福智町", "人口": 21000, "座標": (33.6667, 130.7833)},
    {"市町村": "苅田町", "人口": 36000, "座標": (33.7833, 130.9833)},
    {"市町村": "みやこ町", "人口": 19000, "座標": (33.6667, 131.0000)},
    {"市町村": "吉富町", "人口": 7000, "座標": (33.6167, 131.1833)},
    {"市町村": "上毛町", "人口": 8000, "座標": (33.5667, 131.1667)},
    {"市町村": "築上町", "人口": 18000, "座標": (33.6167, 131.1167)}
]

# データの表示
for municipality in fukuoka_municipalities:
    print(f"{municipality['市町村']}: 人口 {municipality['人口']}人, 座標 {municipality['座標']}")
import folium
import math

# 福岡県の各市町村の人口と座標データ
fukuoka_municipalities = [
    {"市町村": "福岡市", "人口": 1610000, "座標": (33.5902, 130.4017)},
    {"市町村": "北九州市", "人口": 940000, "座標": (33.8833, 130.8756)},
    {"市町村": "久留米市", "人口": 303000, "座標": (33.3192, 130.5081)},
    {"市町村": "飯塚市", "人口": 128000, "座標": (33.6458, 130.6917)},
    {"市町村": "田川市", "人口": 48600, "座標": (33.6361, 130.8069)},
    {"市町村": "柳川市", "人口": 66700, "座標": (33.1631, 130.4094)},
    {"市町村": "八女市", "人口": 64300, "座標": (33.2094, 130.5578)},
    {"市町村": "筑後市", "人口": 48100, "座標": (33.2133, 130.5033)},
    {"市町村": "大牟田市", "人口": 113000, "座標": (33.0333, 130.4500)},
    {"市町村": "行橋市", "人口": 71500, "座標": (33.7283, 130.9833)},
    {"市町村": "豊前市", "人口": 23500, "座標": (33.6111, 131.1278)},
    {"市町村": "中間市", "人口": 41300, "座標": (33.8167, 130.7000)},
    {"市町村": "小郡市", "人口": 60100, "座標": (33.3961, 130.5556)},
    {"市町村": "筑紫野市", "人口": 103000, "座標": (33.4961, 130.5233)},
    {"市町村": "春日市", "人口": 112000, "座標": (33.5350, 130.4700)},
    {"市町村": "大野城市", "人口": 101000, "座標": (33.5350, 130.4783)},
    {"市町村": "宗像市", "人口": 96300, "座標": (33.7961, 130.5333)},
    {"市町村": "太宰府市", "人口": 70700, "座標": (33.5125, 130.5233)},
    {"市町村": "古賀市", "人口": 59800, "座標": (33.7283, 130.4667)},
    {"市町村": "福津市", "人口": 62200, "座標": (33.7667, 130.4833)},
    {"市町村": "うきは市", "人口": 29700, "座標": (33.3450, 130.7500)},
    {"市町村": "宮若市", "人口": 27800, "座標": (33.7333, 130.6167)},
    {"市町村": "嘉麻市", "人口": 37400, "座標": (33.5667, 130.6833)},
    {"市町村": "朝倉市", "人口": 49600, "座標": (33.4211, 130.6650)},
    {"市町村": "みやま市", "人口": 37900, "座標": (33.1500, 130.4500)},
    {"市町村": "糸島市", "人口": 101000, "座標": (33.5583, 130.1950)},
    {"市町村": "那珂川市", "人口": 50700, "座標": (33.5167, 130.4667)},
    {"市町村": "芦屋町", "人口": 14000, "座標": (33.8833, 130.6500)},
    {"市町村": "水巻町", "人口": 28000, "座標": (33.8667, 130.6833)},
    {"市町村": "岡垣町", "人口": 31000, "座標": (33.8333, 130.6167)},
    {"市町村": "遠賀町", "人口": 19000, "座標": (33.8333, 130.6833)},
    {"市町村": "小竹町", "人口": 7000, "座標": (33.7333, 130.7000)},
    {"市町村": "鞍手町", "人口": 17000, "座標": (33.7833, 130.6667)},
    {"市町村": "桂川町", "人口": 13000, "座標": (33.6167, 130.6833)},
    {"市町村": "筑前町", "人口": 28000, "座標": (33.4667, 130.6667)},
    {"市町村": "東峰村", "人口": 2000, "座標": (33.4667, 130.8667)},
    {"市町村": "大刀洗町", "人口": 15000, "座標": (33.4167, 130.6167)},
    {"市町村": "大木町", "人口": 14000, "座標": (33.2167, 130.4167)},
    {"市町村": "広川町", "人口": 20000, "座標": (33.2167, 130.5167)},
    {"市町村": "香春町", "人口": 11000, "座標": (33.6667, 130.8833)},
    {"市町村": "添田町", "人口": 10000, "座標": (33.5667, 130.8833)},
    {"市町村": "糸田町", "人口": 8000, "座標": (33.6333, 130.8000)},
    {"市町村": "川崎町", "人口": 17000, "座標": (33.6000, 130.8167)},
    {"市町村": "大任町", "人口": 5000, "座標": (33.5833, 130.8667)},
    {"市町村": "赤村", "人口": 3000, "座標": (33.5667, 130.9000)},
    {"市町村": "福智町", "人口": 21000, "座標": (33.6667, 130.7833)},
    {"市町村": "苅田町", "人口": 36000, "座標": (33.7833, 130.9833)},
    {"市町村": "みやこ町", "人口": 19000, "座標": (33.6667, 131.0000)},
    {"市町村": "吉富町", "人口": 7000, "座標": (33.6167, 131.1833)},
    {"市町村": "上毛町", "人口": 8000, "座標": (33.5667, 131.1667)},
    {"市町村": "築上町", "人口": 18000, "座標": (33.6167, 131.1167)}
]

# 地図の生成(福岡全体が(だいたい)表示されるように設定)
m = folium.Map(location=[33.5,130.5], zoom_start=10)

# データの可視化
for city in fukuoka_municipalities:
    folium.CircleMarker(
        [city['座標'][0], city['座標'][1]],
        radius=math.sqrt(city['人口']) / 10,  # 人口を面積に反映(適当なスケールに調整)
        color='red',
        fill=True,
        fill_color='blue',
        popup=f"{city['市町村']}: {city['人口']}"
    ).add_to(m)

# 地図の表示
m