I’m building an application that allows users to request data and once a dataframe has been created for said request, the user can then select unique instances of filter_playlist
and/or filter_artist
for further filtering via a multiselect option. However, whenever the user reaches this step, the user can no longer filter the dataframe and is forced to reset the app.
Quick notes:
- the requested dataframe is the input
df
-
ready_button
is in the sidebar and it is activated when valid user credentials and URLs are entered - I call from multiple files in this application (e.g.
proj_analysis
) but I don’t think that’s an issue
def alter_dataframe(df):
if ready_button:
with st.beta_expander("Interact with Data Frame", True):
search_filter = st.radio(label='', options=['Filter','Search'])
if search_filter == 'Filter':
filter_cols = st.beta_columns((3,3,2))
filter_playlist = filter_cols[0].multiselect('Playlist', options=np.sort(data['playlist'].unique()))
filter_artist = filter_cols[1].multiselect('Artist', options=np.sort(data['artist'].unique()))
filter_release = filter_cols[2].slider('Year Range',
min_value=df['artist_date'].min().year,
max_value=df['artist_date'].max().year,
value = (df['artist_date'].min().year, df['artist_date'].max().year),
step=1)
submit = st.button(label='Filter')
if submit:
return proj_analysis.analysis_filter_dataframe(df, filter_playlist, filter_artist, filter_release)
Has anyone experienced something like this before or would know how to troubleshoot this bug? Thanks!