I have a number of csv files with stock data and i create a Pandas data frame with a for symbol in symbol list loop by providing the path and reading these files..The data frame has each stock sub data frame separated..
sym_list = ['AAPL','TSLA','GOOG']for symbol in sym_list: print(symbol) df = pd.read_csv(fr'--some path--{symbol}.csv') # this dataframe prints as separated sub frames for each symbol # the data frame has Date,Open,High and similar Columns of data
I want to add a symbol column to each sub frame,
Merge the 3 sub frames into one continuous final_df ,
Sort the final_df by column ['Date'] .
if anyone can help with this it will be very appreciated!Regards