So I am doing a Time series/LSTM assignment and I have a stock dataset: https://www.kaggle.com/camnugent/sandp500
The thing is that I need to split the main dataframe into smaller dataframes by the name of each company. Is there a fast way to do this? because there are tens of Company names, I have seen that this can be done with iloc but the effort is too much.
df = pd.read_csv('all_stocks_5yr.csv', parse_dates=['date'])
df['date'] = pd.to_datetime(df['date'])
grouped_df = df.groupby('Name')
Here it can be seen better:
As you can see, there are different companies with different names, what I want is a dataframe for each company. Help is much appreciated