Set File_Path for to_csv() in Pandas

You need to either escape your back slashes or better use a raw string:

path='C:\\Users\\hvill\\Destop\\'

or better as fewer characters:

path=r'C:\Users\hvill\Destop\'

I also think you want to do this when saving:

funded.to_csv(path+'greenl.csv')

To avoid the ambiguity and allow portability of your code you can use this:

import os
funded.to_csv(os.path.join(path,r'green1.csv'))

this will append your csv name to your destination path correctly


It may just be the case that you missed the k out of desktop