Spaces:
Sleeping
Sleeping
Download tools/visuals.py from mgbam/BizIntel_AI: direct link, hf CLI and curl.
- Browser
- Download file 800 Bytes
-
https://huggingface.co/spaces/mgbam/BizIntel_AI/resolve/773f0cfdfef56f3cebc157dd3065acdd3c40fa45/tools/visuals.py
- Command line
-
hf download hf://spaces/mgbam/BizIntel_AI@773f0cfdfef56f3cebc157dd3065acdd3c40fa45/tools/visuals.py
-
curl -L -o visuals.py https://huggingface.co/spaces/mgbam/BizIntel_AI/resolve/773f0cfdfef56f3cebc157dd3065acdd3c40fa45/tools/visuals.py
800 Bytes
| import pandas as pd | |
| import plotly.express as px | |
| def histogram_tool(file_path: str, column: str): | |
| df = pd.read_csv(file_path) | |
| fig = px.histogram(df, x=column, nbins=30, title=f"Histogram – {column}", template="plotly_dark") | |
| return fig | |
| def scatter_matrix_tool(file_path: str, cols: list[str]): | |
| df = pd.read_csv(file_path) | |
| fig = px.scatter_matrix(df[cols], title="Scatter‑Matrix", template="plotly_dark") | |
| return fig | |
| def corr_heatmap_tool(file_path: str): | |
| df = pd.read_csv(file_path).select_dtypes("number") | |
| corr = df.corr(numeric_only=True) | |
| fig = px.imshow( | |
| corr, | |
| color_continuous_scale="RdBu", | |
| title="Correlation Heat‑map", | |
| aspect="auto", | |
| labels=dict(color="ρ"), | |
| template="plotly_dark", | |
| ) | |
| return fig | |