My original data has 3 columns - country, downloads and cost in xlsx file.
df = pd.read_excel(xls)
I want to show for each country the total downloads and total cost, in a table that looks good.
I tried using tabulate:
installs_by_country = df.groupby('Country'['downloads'].sum().to_frame(name='downloads').reset_index()
cost_by_country = df.groupby('Country')['Cost'].sum().to_frame(name='Cost').reset_index()
total_per_country = pd.DataFrame({'Country': [installs_by_country['Country']], 'downloads':[installs_by_country['downloads']], 'Cost': [cost_by_country['Cost']]})
print(tabulate(total_per_country, headers=['Country','downloads','Cost'], tablefmt='psql', showindex=False))
But the table appears to have indexes in each column:
How can I fix this? Please help