Gibt es eine Möglichkeit, die INDIA-Karte grafisch darzustellen?Python

Python-Programme
Anonymous
 Gibt es eine Möglichkeit, die INDIA-Karte grafisch darzustellen?

Post by Anonymous »

Ich versuche, eine Indien-Karte mit Plotly zu zeichnen, finde aber keine Möglichkeit, das zu tun. Unten ist der Code, den ich für die USA ausprobiert habe.

Code: Select all

import pandas as pd

df_sample = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/laucnty16.csv')
df_sample['State FIPS Code'] = df_sample['State FIPS Code'].apply(lambda x: str(x).zfill(2))
df_sample['County FIPS Code'] = df_sample['County FIPS Code'].apply(lambda x: str(x).zfill(3))
df_sample['FIPS'] = df_sample['State FIPS Code'] + df_sample['County FIPS Code']

colorscale = ["#f7fbff","#ebf3fb","#deebf7","#d2e3f3","#c6dbef","#b3d2e9","#9ecae1",
"#85bcdb","#6baed6","#57a0ce","#4292c6","#3082be","#2171b5","#1361a9",
"#08519c","#0b4083","#08306b"]
endpts = list(np.linspace(1, 12, len(colorscale) - 1))
fips = df_sample['FIPS'].tolist()
values = df_sample['Unemployment Rate (%)'].tolist()

fig = ff.create_choropleth(
fips=fips, values=values,
binning_endpoints=endpts,
colorscale=colorscale,
show_state_data=False,
show_hover=True, centroid_marker={'opacity': 0},
asp=2.9, title='USA by Unemployment %',
legend_title='% unemployed'
)

fig.layout.template = None
fig.show()
AUSGABE:
Image
In ähnlicher Weise möchte ich nur Indiens Karte mit schwebenden Werten zeichnen.
und möchte nur eine Ausgabe wie unten ...
die Ausgabe von INDIAN MAP:
Image

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post