0

I need to import data from a CSV file to python. Then calculate total customer_value per "last_city".

enter image description here

Here is my code:

import pandas as pd
customer = pd.read_csv('D:\PythonTraining\Customer.csv')
df2 = customer.groupby('Last_city').sum('Customer_Value')
print(df2)

The output is: enter image description here

Why does python return the customer_value in this wired format? How could I change it? FYI the Customer_Value data type is float64.

user1902849
  • 1,073
  • 6
  • 23
  • 31

0 Answers0