After using the groupby and sum operations as follows:
companyGrouped = dailyStocks.groupby(['SYMBOL'])
sumByCompany = companyGrouped.sum()
I end up with a new row for the group by and sum key, this is undesirable as I later want to merge this with another dataframe using [SYMBOL]
. AN image of the table, obtained using: sumByCompany.head()
is shown below.
I've tried a few things to get round this issue, but trying to manually delete this row and set the index as 'SYMBOL'
does not seem elegant! Thanks for any help!!!