I have a long list of named Pandas data frames. My goal is to sort this list alphabetically by the names of the data frames. Here is a MWE:
import pandas as pd
df_1 = pd.DataFrame(None)
df_1.name = 'a'
df_2 = pd.DataFrame(None)
df_2.name = 'b'
df_3 = pd.DataFrame(None)
df_3.name = 'c'
df_list = [df_2, df_1, df_3]
Now, my goal is to sort df_list
such that I get a new list [df_1, df_2, df_3]
reflecting the alphabetical order of the names of the data frames.