When pandas.to_csv
is called with two arguments, the first one means the file name to use (including any absolute or relative path). The second one means the text to use between cells in the output (CSV stands for "comma-separated values", but many programs that "read CSV files" can use different things besides commas, so Pandas gives the option to use something else).
Therefore, funded.to_csv(path,'greenl.csv')
does not make any sense. The path
is a folder name, not a file name, so Pandas cannot open it and write any data. If it could, it would try to use the text greenl.csv
between every cell in the data (instead of a comma), which is clearly nonsense.
To solve the problem, create the full path and use that as the first argument, for example by using os.path.join
, or using the pathlib.Path
class to represent paths.
asada.to_csv(r"" + RESULTS_DIR + "viajes_withDIF_AUX_42.csv", ......
– Brahmi