Here's an example of adding Lat & Long to a real OpenStreet map:
import plotly.express as px
import pandas as pd
df = pd.read_csv("dataset/dataset.csv")
df.dropna(
axis=0,
how='any',
thresh=None,
subset=None,
inplace=True
)
color_scale = [(0, 'orange'), (1,'red')]
fig = px.scatter_mapbox(df,
lat="Lat",
lon="Long",
hover_name="Address",
hover_data=["Address", "Listed"],
color="Listed",
color_continuous_scale=color_scale,
size="Listed",
zoom=8,
height=800,
width=800)
fig.update_layout(mapbox_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
Example CSV:
Address, Lat, Long, Listed
Address #1, -33.941, 18.467, 1250000
Address #2, -33.942, 18.468, 1900000
Address #3, -33.941, 18.467, 1200000
Address #4, -33.936, 18.467, 1195000
Address #5, -33.944, 18.470, 2400000
Example output (interactive map):