I have several data frames: df_1, df_2, df_3, df_4, etc.
I am trying to loop through them, perform an operation and output the name of the dataframe rather than the dataframe itself.
for k in [df_1, df_2, df_3, df_4]:
k.RandomField.value_counts() #or whatever operations
print(k) #this is where I want it to show "df_1", "df_2", etc instead of printing the variable which, in this case, would be the data frame
I know I can create a dictionary but that requires manually generating one. Appreciate your help.
[I am working in Jupyter notebooks and running Python 3.8.]