I've struggling trying to insert a sorting in this code:
all_files = glob.glob(path + "/*.CSV") # To get all csv files disorganized
all_csv = [pd.read_csv(f, sep=',') for f in all_files] # List of dataframes
# I want to sort it by the values of the first column of each dataframe in the all_csv list.
for f in all_csv:
goal = pd.DataFrame.sort_values(by=(f.iloc[:,0])) #Maybe something like this??
So, Anyone has an idea how can I do this? I've looking on other post but does not apply to a undefined column name (a.k.a. f.iloc[:,0] ) or a list of dataframes (I also thought of using dictionaries but I'd like to see if is posible to use with lists).
Thank you :)