Yash Pardeshi
Yash Pardeshi

Reputation: 1

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()```

Upvotes: 0

Views: 606

Answers (1)

Renaud
Renaud

Reputation: 2819

Is your problem is not because you import as px ?

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

Upvotes: 1

Related Questions