Presenting DF

I’m currently using st.table(data) to present my dataframe.

But i need to be able to highlight/color certain fields, if they have a positive og negative number.
I can’t seam to get that working in st.table()

Is there a workaround, or maybe a better way of presenting the data ?

If it makes sense to see it, then the page is running here : https://dev-autobc.cmplab.dk

Thanks

Hey @rhjensen79,

Thanks for posting a link to what you’re looking for! Actually, I believe this is the agGrid component that @PablocFonseca made!

Here is a link to all the components, the AgGrid one is there as well!

Happy Streamlit-ing!
Marisa

I’m already using agGrid to take inputs, after recomendation from @PablocFonseca

Do any of you know, if the source if the data, can be updated, when data is modified ?
So i only need to have one agGrid table. or do i need to have one for both input and output ?

I tried a couple of things, but could not make it update itself, even thou i read the documentations, as it should be possible ?

Thanks.

1 Like

@rhjensen79, the grid call has an reload_data=True|False argument, if it is true, grid will reload the values of the input data and return it, if False component will return the data already on the grid.

Please note that setting this to always True, will cause the grid to reload the original data on every streamlit refresh, including after cells editions.

In this case, the state of you application (the edited dataframe in this case) needs to be stored somewhere else in order to “survive” streamlit refresh (a text file, for example).

I do not know your use case. But temporary text files may be a bad idea because of performance. If you look in the forums there is a discussion regarding session state, which is one way of holding the state of your application in memory between streamlit refreshs.

1 Like

Thanks

My usecase is quite limited, and so is the data.
So iøm guessing that i can just use the same dataframe, and just update that one, and then the grid sould reload, with the new data, if reload_data=true

I will try.
Thanks :slight_smile:

Hey @rhjensen79,

:woman_facepalming:
TOTAlLY missed the mark on that one! Sorry! I thought you were linking an example of what you wanted to create, not what you had so far :rofl:

Hopefully the reload_data works well for you

(Well done @PablocFonseca on actually posing a possible solution)

Happy Streamlit-ing!
Marisa

1 Like

ha ha no problem @Marisa_Smith.
I read your reply as a solution for me to look into agGrid, so i was happy :slight_smile:

Thanks for really great support, both of you.
It means a lot, when you are stuck.

/Robert