Spaces:
Sleeping
Sleeping
File size: 800 Bytes
bf400de |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
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
|