Bar = df.groupby(‘Explicit Track’)[df.columns[7:-1]].sum()
Bar.columns = [Bar.columns.to_list()[i].split(‘ ‘)[0] for i in np.arange(Bar.columns.size)]
Bar[‘Pandora’] = Bar[‘Pandora’].sum(axis=1)
Bar
It was supposed to be one column with values 195565028885 and 104049495464
enter image description here
New contributor
Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.