I have faced issues when I’m running some charts in Streamlit using Pandas 1.3 or greater, and to fix it I needed to downgraded the Pandas to any version below 1.3.
The most common error is: TypeError: _translate() missing 2 required positional arguments: ‘sparse_index’ and ‘sparse_cols’
Any update about whether it is planned to be fixed in the future?
Yes, we have an internal tool in Streamlit, that it does not work properly on Streamlit when the Pandas version is greater than 1.3. The charts don’t appear on the Streamlit interface, what happens instead is an error message - see below.
TypeError: _translate() missing 2 required positional arguments: 'sparse_index' and 'sparse_cols'
File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\script_runner.py", line 332, in _run_script
exec(code, module.__dict__)File "C:\ProgramData\Anaconda3\Lib\site-packages\pyrpa\UI\capping_ui_v2.py", line 340, in <module>
st.table(data=dec_df)File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\elements\data_frame_proto.py", line 119, in table
marshall_data_frame(data, table_proto)File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\elements\data_frame_proto.py", line 149, in marshall_data_frame
_marshall_styles(proto_df.style, df, styler)File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\elements\data_frame_proto.py", line 168, in _marshall_styles
translated_style = styler._translate()
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.