How to save a dataframe with the same dataframe name in python?
Isn't the dataframe name the same as variable name? If so, the variable name is fixed, isn't it? If it is fixed, you know it when running the code.
How to save a dataframe with the same dataframe name in python?
In order to do that I need to extract the name of the dataframe and use it as a text to save to csv file. like dataframe.to_csv('name of the dataframe'+'.csv). My question is how to extract the name of the dataframe.
Example:
I have a dataframe that is randomly generated as XX_20135.
XX_20135.to_csv('XX_20135.csv') so in the output I will have the csv name as XX_20135. I don't know the name of the df in advance as it is generated randomly.