Spaces:
Running
Running
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) |