Im trying to have double slider but it wont work if i pass dataframe:
with col4:
minMiles = df["Miles"].min()
maxMiles = df["Miles"].max()
mylios = st.slider('Miles', value=[0, 5000])
gets me error : ValueError: operands could not be broadcast together with shapes (676,) (2,)
wich leads to my filter of things :
df = df[(df[“Date”] >= date1) & (df[“Date”] <= date2) & (df[“Weight”] <= svoris) & (df[“Miles”] <= mylios)].copy()
^^^^^^^^^^^^^^^^^^^^^
Miles in my column varies but most of them have .00 values like 652.7 or 564.77 etc.
If i change value to minMiles and maxMiles im gettin the same error.
I tried different approach:
minMiles = df["Miles"].min()
maxMiles = df["Miles"].max()
minMiles, maxMiles = st.select_slider('Select Range',
options=['0', '5000'],
value=(minMiles, maxMiles)
)
# mylios = st.slider('Miles', value=[minMiles, maxMiles])
df = df[(df["PDate"] >= date1) & (df["PDate"] <= date2) & (df["Weight"] <= svoris) & (df["Miles"] <= minMiles, maxMiles)].copy()
getting this error:
ValueError: 139.1 is not in iterable
minMiles, maxMiles = st.select_slider(‘Select Range’,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
How do i need to deal with ? only one way slider works, but imlooking for double sided so i can choose my trip beteween the ranges i want and not from 0 to what ever i choose.
I also tried from Streamlit Youtube video Streamlit Double Sliders same outcome as the first one.
My Miles column is float64.