Hi, i have a csv data with many year information about temperature is posible show in map with color and cover this map i have a 2 column with lat and long with other 12 column with represent month of year.
can someone tell me what to read to do this or is possible?
thank
Hi @Carlos_Rocha, welcome to the Streamlit community!
We have a convenience function st.map()
that sounds like what you are trying to do:
https://docs.streamlit.io/en/stable/api.html?highlight=pydeck#streamlit.map
If you need more control over the map, st.map
is stpydeck_chart
under-the-hood, so you can customize whatever you’d like based on the pydeck Python library
https://docs.streamlit.io/en/stable/api.html?highlight=pydeck#streamlit.pydeck_chart
Best,
Randy
Hi @randyzwitch yes st.map() i used but i have a more question
my csv have column lat,lon temperature, i would like put in the map temperature
i have this code
DATA_URL = ('../path/file.csv')
@st.cache
def load_data(nrows):
data = pd.read_csv(DATA_URL, nrows=nrows)
lowercase = lambda x: str(x).lower()
return data
data = load_data(10000)
df = pd.DataFrame({'lat': data['lat'], 'lon': data['lon']})
st.map(df)
this code put the point in the map for latitud and longitud not the temperature
how to put the temperature??
Right, st.map()
is for quick geospatial scatterplots. Since you need more control, you’ll need to use st.pydeck_chart
https://docs.streamlit.io/en/stable/api.html?highlight=pydeck#streamlit.pydeck_chart
From the pydeck documentation (I haven’t tried it though), it appears that you can use an expression parser to pass values to vary the colormap of a scatterplot:
https://deckgl.readthedocs.io/en/stable/layer.html#expression-parsers-in-pydeck-objects