Iâve been struggling to figure out how to resolve this issue and have tried everything I can think of and canât figure out how to resolve it.
Basically, whenever a float value has a leading 0.0 all leading 0s are being removed before the dataframe is rendered in streamlit.
Here is a screenshot of what shows in streamlit:
Here is a screenshot of the df in my IDE before it is added to streamlit:
You can see the âExecutive & Adminâ value is 0.091400 but in the streamlit UI it shows it as 91400.
If there are more leading 0s like 0.0000100 it would just show as 100. No idea why and not sure what to do to fix it?
It works totally fine if I manually create a data frame and type in 0.00123, but if the data comes from a query from st.experimental_connection, it doesnât seem to work
Using the snowpark connection. Iâve tried both the direct result from the snowpark connection.query(sql) as well as taking that result and attempting to convert it to a pandas dataframe (even though Iâm pretty sure that query returns a pandas dataframe).
I have a feeling if you connect to snowflake via snowpark and do something as simple as select 0.000123 as f and put those results into the table, it wouldnât render correctly, but havenât tried it yetâŚ
@CarlosSerrano is there any way to do this generically? Ideally a solution that formats float columns as float, but non-float columns as ints and strings? I guess I could look at the data to do this, but was hoping for a âsimplerâ solution.