0
$\begingroup$

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
$\endgroup$
2
$\begingroup$

You 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!

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.