Hello @abhi ,
Thank you for the reply. The problem is with the select_slider not with the slider, my apologies for the confusion. I was able to work out a stripped-down code with the dummy data. Also, today I upgraded the streamlit from v0.84.1 to v0.84.2 and the issue still exists.
import sys
import streamlit as st
import pandas as pd
data = [['TX', 'X', '2018-07-19 06:14:18+00:00', 'Role 2'],
['TX', 'Y', '2018-07-19 06:28:03+00:00', 'Role 5'],
['TX', 'Z', '2018-07-19 06:28:31+00:00', 'Role 2'],
['TX', 'A', '2018-07-19 06:34:00+00:00', 'Role 4'],
['TX', 'C', '2018-07-19 06:34:00+00:00', 'Role 4'],
['TX', 'B', '2018-07-19 09:33:56+00:00','Role 1'],
['TX', 'A', '2018-07-19 18:00:00+00:00','Role 4'],
['TX', 'C', '2018-07-21 06:00:00+00:00','Role 4'],
['TX', 'A', '2018-07-21 06:00:00+00:00', 'Role 4'],
['TX', 'A', '2018-07-23 06:00:00+00:00', 'Role 4'],
['TX', 'C', '2018-07-23 06:00:00+00:00', 'Role 4'],
['TX', 'C', '2018-07-24 06:00:00+00:00', 'Role 4'],
['TX', 'A', '2018-07-24 06:00:00+00:00', 'Role 4'],
['TX', 'C', '2018-07-27 06:00:00+00:00', 'Role 4'],
['TX', 'A', '2018-07-27 06:00:00+00:00', 'Role 4'],
['TX', 'E', '2018-07-27 12:00:00+00:00', 'Role 6']]
def main(argv, filter_parms=None, filter_parameter=None):
#Dashboard Title
st.title("⏭️Next Event Prediction Dashboard")
st.sidebar.title("🎛️ App Control Menu")
if not argv:
_folder_name = st.sidebar.text_input('Any Random Text')
def next_columns(filter_log):
filter_caseid = st.selectbox("🆔 Select Case ID", filter_log["caseid"].unique())
filter_caseid_attr_df = filter_log.loc[filter_log["caseid"].isin([filter_caseid])]
return filter_caseid, filter_caseid_attr_df
if _folder_name != "":
# Read the Test Log
filter_log = pd.DataFrame.from_records(data, columns=['caseid', 'task', 'timestamp', 'role'])
filter_log = filter_log.astype({'caseid': object})
essential_columns = ['task', 'role', 'timestamp']
filter_caseid, filter_caseid_attr_df = next_columns(filter_log)
filter_caseid_attr_ = filter_caseid_attr_df[essential_columns].values.tolist()
filter_caseid_attr_list = st.select_slider("Choose [Activity, User, Time]", options=filter_caseid_attr_, key="_slider")
_idx = filter_caseid_attr_.index(filter_caseid_attr_list)
filter_caseid_attr_list.append(_idx)
if __name__ == "__main__":
main(sys.argv[1:])
And the screencast of the above code:
Please let me know if you need anything else, Thank You.