Spaces:
Sleeping
Sleeping
Update tools/excel_tool.py
Browse files123456789345678import pandas as pd
def analyze_excel(filepath: str) -> str: df = pd.read_excel(filepath) # Summing up all numeric food items if 'category' exists if '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"def 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