How do I get the name of a DataFrame and print it as a string?
Example:
boston (var name assigned to a csv file)
boston
import pandas
You can name the dataframe with the following, and then call the name wherever you like:
import pandas as pd df = pd.DataFrame( data=np.ones([4,4]) ) df.name = 'Ones' print df.name >>> Ones
Hope that helps.