I had previously written a script which contained a function for converting a dataframe to .csv and storing it locally, and it had worked in the past, but now i've come to use it again and it will not work:
def write_to_csv(dataframe, filename):
timestamp = datetime.utcnow().isoformat()
dataframe.to_csv(fr'C:/Users/freddie.bazanye-lutu/BBDS_Repo/Scripts/{filename}-{timestamp}.csv', index=False, header=True)
Everytime I run it produces this error:
OSError: [Errno 22] Invalid argument: 'C:/Users/freddie.bazanye-lutu/BBDS_Repo/Scripts/Sandbox_glue_catalog-2021-10-08T10:56:27.991570.csv'
I've tried changing the directions of the slashes, I've updated pandas to the latest version and I've tried changing the location of where i want my file to be saved, all to no avail