Spaces:
Sleeping
Sleeping
Update tools/excel_tool.py
Browse files123456789import pandas as pddef analyze_excel(filepath: str) -> str:df = pd.read_excel(filepath)# Summing up all numeric food items if 'category' existsif 'category' in df.columns and 'amount' in df.columns:food_sales = df[df['category'].str.lower() == 'food']return f"{food_sales['amount'].sum():.2f}"return "0.00"12345678import pandas as pddef analyze_excel(file_path: str) -> str:try:df = pd.read_excel(file_path)return df.to_string(index=False)except Exception as e:return f"Error reading Excel file: {e}"
tools/excel_tool.py+6-7