Spaces:
Build error
Build error
Download app.py from 12manish/Anyalises_tool_2: direct link, hf CLI and curl.
- Browser
- Download file 913 Bytes
-
https://huggingface.co/spaces/12manish/Anyalises_tool_2/resolve/main/app.py
- Command line
-
hf download hf://spaces/12manish/Anyalises_tool_2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/12manish/Anyalises_tool_2/resolve/main/app.py
913 Bytes
| import gradio as gr | |
| import pandas as pd | |
| import io | |
| def analyze_data(text): | |
| if not text.strip(): | |
| return "कुछ data तो डालो यार!" | |
| try: | |
| df = pd.read_csv(io.StringIO(text)) | |
| summary = f"✅ कुल rows: {len(df)}\n" | |
| summary += f"✅ कुल columns: {len(df.columns)}\n" | |
| summary += f"📋 Columns: {list(df.columns)}\n" | |
| summary += f"🔍 पहली 5 rows:\n{df.head().to_string()}\n" | |
| summary += f"📊 Basic Stats:\n{df.describe().to_string()}" | |
| return summary | |
| except Exception as e: | |
| return f"गड़बड़ हुई: {e}" | |
| app = gr.Interface( | |
| fn=analyze_data, | |
| inputs=gr.Textbox( | |
| label="Data yahan paste karo", | |
| placeholder="name,age,city\nRam,25,Delhi", | |
| lines=10 | |
| ), | |
| outputs="text", | |
| title="Data Analysis Tool" | |
| ) | |
| if __name__ == "__main__": | |
| app.launch() |