Spaces:
Sleeping
Sleeping
Update tools/excel_tool.py
Browse files12345678import 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}"123456789101112131415import pandas as pdimport requestsfrom io import BytesIOdef analyze_excel(path_or_url: str) -> str:try:if path_or_url.startswith("http"):response = requests.get(path_or_url)df = pd.read_excel(BytesIO(response.content))else:df = pd.read_excel(path_or_url)except Exception as e:return f"Error reading Excel file: {e}"return f"Loaded sheet with shape {df.shape} and columns: {', '.join(df.columns)}"
tools/excel_tool.py+10-3