Download Python program Automated EDA with Generative AI from avra121/xyz: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/avra121/xyz/resolve/main/Python%20program%20Automated%20EDA%20with%20Generative%20AI
- Command line
-
hf download 'hf://spaces/avra121/xyz/Python program Automated EDA with Generative AI'
-
curl -L -o 'Python program Automated EDA with Generative AI' https://huggingface.co/spaces/avra121/xyz/resolve/main/Python%20program%20Automated%20EDA%20with%20Generative%20AI
1.09 kB
| import pandas as pd | |
| import numpy as np | |
| try: | |
| df = pd.read_csv("dataset.csv") | |
| except FileNotFoundError: | |
| print("dataset.csv not found. Creating a sample DataFrame for demonstration.") | |
| data = { | |
| 'Feature1': np.random.rand(100), | |
| 'Feature2': np.random.rand(100) * 10, | |
| 'Feature3': np.random.randint(1, 100, 100), | |
| 'Target': np.random.choice([0, 1], 100) | |
| } | |
| df = pd.DataFrame(data) | |
| df.loc[df.sample(frac=0.05).index, 'Feature1'] = np.nan | |
| print("Dataset Shape:", df.shape) | |
| print("\nData Types:\n", df.dtypes) | |
| missing = df.isnull().sum() | |
| print("\nMissing Values:\n", missing) | |
| if missing.sum() == 0: | |
| print("GenAI Insight: Dataset has no missing values.") | |
| else: | |
| print("GenAI Insight: Missing values found, data cleaning required.") | |
| print("\nStatistical Summary:\n", df.describe()) | |
| corr = df.corr(numeric_only=True) | |
| print("\nCorrelation Matrix:\n", corr) | |
| if (corr.abs() > 0.7).any().any(): | |
| print("GenAI Insight: Strong correlation exists between some features.") | |
| else: | |
| print("GenAI Insight: No strong correlation detected.") |