I have this simple code which saves a pandas dataframe to a csv file. As of now, it works by overwriting the filename so each time I run it it just replaces the old file with a new one with the same name. Is it possible to save this dataframe but have it create new files sequentially, ie if there is already some file called "filename1" in the directory make the new one called "filename2" so the data from the original file is not just lost?
import pandas
datamatrix= [[1,2,3],[1,2,3],[1,2,3]])
x=pandas.DataFrame(datamatrix)
pandas.DataFrame.to_csv(x,"filename.csv",',')