The provided code imports the excel file and removes the not NaN values and store it in df2. Now, How do i save the changes to an another file.
df1 = pd.read_excel('file_name.xlsx')
df2 = df1[pd.isnull(df1['column_name'])]
df2
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityYou could simply use:
df2.to_excel("output.xlsx")
I suggest you take some time to look at the various functionalities pandas offers. Will be great help to you in future!