Summary
Hi I would like to set a range for the slider - for example 1 day or 3 days. At the moment there is no set range so user can choose range from 2 to more than 1000 days.
Steps to reproduce
Code snippet:
def df_filter(message,df):
dates_selection = st.slider('%s' % (message),
min_value = min(df['Date']),
max_value = max(df['Date']),
value =(min(df['Date']),max(df['Date'])))
mask = df['Date'].between(*dates_selection)
number_of_result = df[mask].shape[0]
filtered_df = df[mask]
return filtered_df
if __name__ == '__main__':
df = pd.DataFrame(heartrate_new)
st.header('Datetime Filter')
filtered_df = df_filter('Move sliders to filter dataframe',df)
filtered_df.sort_values(by='Date', inplace = True)
container1 = st.container()
with container1:
st.header('Data Frame')
st.write(filtered_df)
Additional information
If needed, add any other context about the problem here.