Get the name of a pandas DataFrame

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.

Leave a Comment