Highlight values in dataframe
Hello, I have a dataframe with a bunch of numbers and want to find extremes and show what is going on in these cases.
To locate extremes I find useful to style dataframe by df.style.background_gradient and show by solara.display. However, with this I cannot attach cell actions. When using solara.DataFrame I can attach cell actions, but it does not work for styled dataframes. Is there any chance to combine both?
The attempt is attached, but it does not work due the lack of pandas and seaborn
Thank you
https://py.cafe/snippet/solara/v1#c=H4sIAHqY7mYAA41SXWvbQBD8K-KeZFCEnWIKAkPpF30spbQPljEr3co6erq73q2SCOP_nj3JVghJcGw9aGdndmYXHUVtJYpCqM5ZT0mwGjyUpjRnwIGREBJ-nJzBgFBZbyIaTJhh03duiKBxcQIlG37LtTLBQY3pMlvFZ1Ea2XDLyfwrEHz30GGqjMSHDY29bSmgFLtJHZRJZ7ia4dqGEa47rjkDuxxa2jvQSIQpU3WPpcg4zb7uwG1--x6ZH2jQKPdjANnkY5lXUP87eNsbuT94kAoNpaOo7liSxF0-TYdhX17VMIETYZP8hAOmi4JJ_DtTpApOw5DOVguRCY__e-WxY2Xga1_OzB0aXLz_hHANzv1ReC-KBnTATKBU9M1ApZlFvEQm3ECtNaxxg5VK4s3dMr9d5ysWs6_tSRRHcYc-qMi6ZXNr6ZflkceLm-cqE3WrtPTIpO3cIagCEjfvlaRWFKv1MhOdMn-n8sNU_cB47qlUkmWN0viZpwb0X6whUAb9Gw6RelNNXKY4iHOFOO1O2csUb0R80vG5cjc8V79ju-sbnRNe2-ayyOvx2_PU1cf1ezwJPcOgr5leeNE1_k_ZeFX-sra70yOTltHF0wMAAA
PyCafe
Playground for Python web frameworks. Run and edit Python code snippets for web frameworks in a web browser.
3 Replies
you can install it by editing the requirements.txt e.g.:
https://py.cafe/snippet/solara/v1#c=H4sIAJDZ82YAA41W227bOBD9FUN9SQFLsGTHTgIIWOwN-7hYLHYf6iKgSdpmLZEMSSVRi_z7nhnJStJukbZBkBnO_XJGXzLplM5uMtN6F9IsukYEsbVbOzK8sErEGX68mphRi50LlrjRxoltu9b3xLSeLKRZjb-Kx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N-3kLWx_RNAo3Y5b4_MDrRG-_Ai7epKJRNCb2TeUBhGvZZYkHQnFaEk3IPqBKG-JnMTYLpqQ7E7nwUe6RGkwRbrUi-cakxO5Lirj6zcmNxxiEMv2wWzeCx5Eq3JqaOXsk6aLuTjYjRSG7pi0LQw1BkaHIg4DiL-MHChK8pA7vb04KBg7lcMEfHlIvYW0kYUw4YY13SO-cw4WtE-8LHyM_j0YxbSCbo04R0K_bh4DLgVqKWG3QW5oZLPGwDqkGkk9gilH7kYlg9AAARLLC5JKMfvZaIc1Vg_qYAPKAAmAqw4HptaHy9aRrGNSTN3hqRKEtlyPoKnV6DGVyr01F3cZpFRM-DTk8-5bS_JwM-FXqFPvhI20WVui6uniMA3AcndeQpGtLrgsbUihEpKfpeUjrDuFaU3DR5mAheYt-3PDv6EfeAPh-oEtw5fhy-No4p-cEoM8kmAxRtIXNAR7on46Kya8YGJZIewq9QUMzNyKclzRt3OAyxIQN--jxCMxvoBcEioTn7-Nze4RXQ9aIPAYifCC4IaKFEtx-DxPktuaphL5fL5XWOshgEQ9hLE435oJfrq_XXL_AVDJ2RckngPVDULALasxuvIq8aFK5ehDN-4jGfb0bUVlUp4MBOurgunR9Bek3IR2LmkdeIhz5ag5PES8BHa_hMZJIhcKAnHPqK3fExO7Ow_wY4Np3WmHBMqSmwN-IaWIE_qBmNGL9H8FK8BkgQijhIvYwRyDuebdRrkOBdQ4omwQqfWpwX2KXPESrSN2OA0HDAqtXieoGFgBhG6dX4rYZD2AUDGG1pjfiWsFtAEqBqOd3G7t4AvLniSyS0tQ8iyaNyGM7Xk8J8_hA6b9zzk-QP33HAEfqDBmI1jj9CVuga_IClcfPHDxqCdEQIZoQFfC6cd5l6PEgPD7RM3MQR1vHtck50CJDcxdjg111jkgaVPf0HRDRf5rANAAA
There is an issue open on this, see https://github.com/widgetti/solara/issues/110
We are open to start working on supporting this. If you subscribe to the issue, you can stay up to date and give feedback
chaffra
<:issue_open:882464248951877682> [widgetti/solara] [Feature Request] solara DataFrame should handle pandas Styler
If you have a styled
df = pandas.DataFrame().style
, you can pass it as sdf = solara.DataFrame(df.data)
but you loose the styling that was applied to df. So if columns were hidden by the styler, they are displayed again. It would be good for solara.DataFrame to reapply the style before when displaying sdf in a notebook for example.Created
Thank you.