Dealing with the RangeError on `st.slider`?

Hi guys!

I’ve got a RangeError with st.slider, where I get my min and max values dynamically from a dataframe,

The issue is raised as the min value (100) is equal to the max value (100)

Here’s a video of the error in the app:


Here’s the related error code:

RangeError: min (100) is equal/bigger than max (100)
at Object.t.checkBoundaries (
at Array.forEach (<anonymous>)
at t.componentDidMount (
at Ks (
at t.unstable_runWithPriority (
at pi (
at Zs (
at Fs (

Heres’ my Python code:

maxValueToken_set = dfRatio['token_set_ratio'].max()
    minValueToken_set = dfRatio['token_set_ratio'].min()
    Token_set_slider = st.slider('token set ratio values', minValueToken_set, maxValueToken_set, value = maxValueToken_set, step = 1.00)

After trying several error handling methods, nothing has worked so far - I’ll keep digging but any idea?


I think this is probably one of those things you’d need to catch in the codebase; from the slider perspective, there’s no way to show zero width (100 to 100), so I think it’s right to throw an error.

Is this a scenario where you can reasonably expect to have columns with constant values?

1 Like

Thanks for the prompt response Randy!

Yes, one can reasonably expect to have columns with constant values with this web app.

I’ll try to find a workaround and will keep you posted on the progress here! :slight_smile:


1 Like

Since you’re already calculating min and max, could you do something like:

if minValueToken_set < maxValueToken_set:
   st.write("This column is a constant of value `minValueToken`")
1 Like