Spaces:
Running
Running
File size: 483 Bytes
9a6a4dc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import pandas as pd
def calculate_food_sales(file_path):
# Read the Excel file
df = pd.read_excel(file_path)
# Filter out the rows where Category is 'Drink'
food_sales = df[df['Category'] != 'Drink']
# Calculate the total sales for food items
total_sales = food_sales['Sales'].sum()
return total_sales
# Call the function and print the result
file_path = '/tmp/tmpn1g1t02t.xlsx'
total_food_sales = calculate_food_sales(file_path)
print(total_food_sales) |