简体   繁体   中英

module 'plotly.express' has no attribute 'density_mapbox'

I have given snippet of my code. so when I tried to run it gave me error that 'plotly.express' has no attribute 'density_mapbox' . how to resolve this?

import pandas as pd
import plotly
import plotly.express as px
fig=plotly.express.density_mapbox(df_latlong,lat="Lat",lon="Long",hover_name="Province/State",
hover_data=["Confirmed","Deaths","Recovered"],animation_frame="Date",color_continuous_scale="Portland",
radius=7,zoom=0,height=700)
fig.update_layout(title='Worldwide Corona Virus Cases')
fig.update_layout(mapbox_style="open-street-map",mapbox_center_lon=0)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()```

Is your problem is not because you import as px?

fig=px.density_mapbox(df_latlong,lat="Lat",lon="Long",hover_name="Province/State

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM