I’m currently reading the streamlit documentation trying to find a feature that allow me create editable data tables “a columns with editable cells like excel”
if anyone could give me some help, will be appreciated
Thanks in advance for your support
take a look here I think it can help you.
This looks really awesome, but very complex…
By any chance is there another way to interact dynamically with dataframes ? Appending rows in existing dataframe or changing dataframes values on the fly ?
@blob123 I “think” (but @ash2shukla is the expert in this so I’ll let him chime in…) you can use a combination of Bokeh datatable + streamlit-bokeh-events for editable tables, but that may be a bit more complex to use too…
I know the Streamlit team is thinking about it but there’s no immediate timeframe for its development so in the meantime if you need an editable datatable, your best bet is writing a component for it
Have you looked at Streamlit’s add_rows functionality? You’ll see code examples for adding data to a dataframe and showing the result in a plot in real time.
For this one you may be better off overwriting the dataframe variable for now.
@andfanilo, is it possible to get an example of a dataframe variable that could be overwritten ?
Many thanks @ash2shukla, but I’m having hard time running your last example (from state import provide_state => SyntaxError: invalid syntax)
You need to get the provide_state decorator from state module. you can find it here, https://gist.github.com/ash2shukla/ff180d7fbe8ec3a0240f19f4452acde7
Yes, that’s what I did, but do I just need to place the provide_state decorator in my folder ?
Yes just place it with your other modules…
Yes, I solved my issue: I used os.chdir(“C:\…”) in order to point on the directory where the decorator is present.
This last example is really awesome.
But this is hard to implement in an user interactive app, because a bit far from a full editable dataframe in an “Excel” fashion, to record user’s inputs…
I try to create an app with an optimization function, variables and constraints: I don’t know how to input the various parameters of my bunch of constraints. That’s why I was also thinking of an editable table.
Maybe instead of this editable table, what could be the best way to populate e.g. a 4x4 table for the app user ?