| name | sweetviz-1-basic-eda-report-analyze |
| description | Sub-skill of sweetviz: 1. Basic EDA Report (Analyze). |
| version | 1.0.0 |
| category | data-analysis |
| type | reference |
| scripts_exempt | true |
1. Basic EDA Report (Analyze)
1. Basic EDA Report (Analyze)
Single Dataset Analysis:
import sweetviz as sv
import pandas as pd
import numpy as np
df = pd.read_csv("data.csv")
report = sv.analyze(df)
report.show_html("sweetviz_report.html")
report.show_notebook()
With Source Name:
import sweetviz as sv
import pandas as pd
df = pd.read_csv("sales_data.csv")
report = sv.analyze(
source=df,
pairwise_analysis="auto"
)
report.show_html("sales_analysis.html", open_browser=True)
Sample Dataset for Examples:
import sweetviz as sv
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
np.random.seed(42)
n = 5000
df = pd.DataFrame({
"age": np.random.randint(18, 80, n),
"income": np.random.exponential(50000, n),
"credit_score": np.random.normal(700, 50, n).clip(300, 850).astype(int),
"account_balance": np.random.exponential(10000, n),
"transaction_count": np.random.poisson(15, n),
"gender": np.random.choice(["Male", "Female", "Other"], n, p=[0.48, 0.48, 0.04]),
"education": np.random.choice(
["High School", "Bachelor", "Master", "PhD"],
n, p=[0.3, 0.4, 0.2, 0.1]
),
"employment_status": np.random.choice(
["Employed", "Self-employed", "Unemployed", "Retired"],
n, p=[, , , ]
),
: np.random.choice([, , , ], n),
: [
datetime(, , ) + timedelta(days=(d))
d np.random.uniform(, , n)
],
: np.random.choice([, ], n, p=[, ])
})
df.loc[np.random.choice(n, ), ] = np.nan
df.loc[np.random.choice(n, ), ] = np.nan
df.loc[np.random.choice(n, ), ] = np.nan
report = sv.analyze(df)
report.show_html()