NameError: name is not defined

while saving a file with a new name, i am getting below error:“new file name is not defined”.
Please find attached

screenshot for your reference and kindly suggest the correct syntax

Hey @dasgupta.r87,

Please elaborate on what you intend to do, and in the above you haved defined planets_new you probably meant to use planets.

‘planets’ is the existing file and ‘planets_new’ is the new file where i am going save my data…hope it is clear now

In the 6th line:

np.savetxt("planets_new.txt", planets_new )

The planets_new, shown above isn’t declared

ya …so what is the solution?

It should work with the following:

np.savetxt("planets_new.txt", planets)
1 Like

Yes…it is working…Thanks a lot