6. Aggregate Functions & Groupby

file-download
75MB
  1. Find the total revenue generated from all transactions.

chevron-rightSolutionhashtag
print(df['Total_Amount'].sum())

# Output
401978248.89447826
  1. Find the average value of the orders.

chevron-rightSolutionhashtag
print(df['Total_Amount'].mean())

# Output
1367.6869831155632
  1. Find the highest sale value.

chevron-rightSolutionhashtag
print(df['Total_Amount'].max())

# Output
4999.625796
  1. Find the lowest sale value.

chevron-rightSolutionhashtag
  1. Find the average rating given by customers.

chevron-rightSolutionhashtag
  1. Find the total number of products sold.

chevron-rightSolutionhashtag
  1. Find the city and country with highest frequencies.

chevron-rightSolutionhashtag
  1. Count the number of transactions per country wise.

chevron-rightSolutionhashtag
  1. Find the total sales city wise.

chevron-rightSolutionhashtag
  1. Find out average sales for every product category.

chevron-rightSolutionhashtag
  1. Create a new dataset which contains the total sale value of each brand.

chevron-rightSolutionhashtag
  1. Find out the highest average transaction value as per payment method.

chevron-rightSolutionhashtag
  1. Find the total number of transactions for each shipping method.

chevron-rightSolutionhashtag
  1. Find out the top sale from each country.

chevron-rightSolutionhashtag
  1. Find out total number of transactions for each product category in every country.

chevron-rightSolutionhashtag
  1. Find out the total number of transactions for each payment method for every country.

chevron-rightSolutionhashtag

Last updated