File size: 1,180 Bytes
55ae01b 20fc64c 55ae01b 5bdae2b 7edab87 2c1e3dd 3aa9d74 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
import streamlit as st
import pandas as pd
st.title('AppMap')
st.markdown('This is a simple app to help you visualize your app\'s data.')
st.markdown('**Note:** This app is still in development. Please report any bugs or suggestions to [@napoles3D](https://twitter.com/napoles3D)')
filepath = 'https://raw.githubusercontent.com/napoles-uach/Pycon_cl_taller/main/meteorite-landings.csv'
@st.cache
def read_csv(file_path):
df = pd.read_csv(file_path)
return df
df = read_csv(filepath)
st.button('test')
df=df[(df['mass']>0 )] #evitar algunos valores incompletos
df=df[abs(df['lat'])>0] #evitar algunos valores incompletos
year_min=int(df['year'].min()) #identificamos el valor mínimo
year_max=int(df['year'].max()) #identificamos el valor máximo
cols=list(df.columns) # lista con nombres de columnas en el csv
# separamos en columnas
col1,col2,col3 = st.columns([5,1,5])
with col1.expander('widgets'):
year_range = st.slider('year range',year_min,year_max,[1800,1900],step=10)
vals=st.multiselect('',cols)
df1=df[(df['year']>=year_range[0] ) & (df['year']<=year_range[1] )]
df2=df1[vals]
with col1.expander('data'):
st.dataframe(df2) |