first of all let me tell you how happy that I found streamlit. I am already testing it extensively. I have a question and would be really happy if you could support me.
I have following testframe
import pandas as pd
import numpy as np
import streamlit as st
from st_aggrid import AgGrid
testFrame=pd.DataFrame({"col1":[np.nan,1,2,4],"col2":[np.nan,np.nan,np.nan,np.nan]})
grid_return=AgGrid(testFrame, editable=True)
General=grid_return["data"]
new_df=General
st.write(new_df)
The output, however contains artefacts, I dont want to have, since in a later step I am saving the file as excel, and having them is not nice
thanks for your help. Almost the solution.
However, if I change the cell value in Col2 in the browser (let’s say first row will be changed to 2) then I get the new_df blanks will be filled with .
The strange thing is that in the above example your solution works, but on my dataframe I get again the data if I change a cell value.
I also copied my original frame and applied the above codes on the copied one, but no succes.
@Isaak_Saba I’m not sure I totally understand the problem, but it might be solved by not actually saving the fillna, but just displaying it. This way, if you’re using new_df later on, it won’t have the NaN’s replaced with anything.
import numpy as np
import pandas as pd
import streamlit as st
from st_aggrid import AgGrid
testFrame=pd.DataFrame({"col1":[np.nan,1,2,4],"col2":[np.nan,np.nan,np.nan,np.nan]})
grid_return=AgGrid(testFrame, editable=True)
General=grid_return["data"]
new_df=General
st.write(new_df.fillna(""))
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.