Spaces:
Sleeping
Sleeping
Download env/data_generator.py from disha2005/data-cleaning-env-final: direct link, hf CLI and curl.
- Browser
- Download file 489 Bytes
-
https://huggingface.co/spaces/disha2005/data-cleaning-env-final/resolve/main/env/data_generator.py
- Command line
-
hf download hf://spaces/disha2005/data-cleaning-env-final/env/data_generator.py
-
curl -L -o data_generator.py https://huggingface.co/spaces/disha2005/data-cleaning-env-final/resolve/main/env/data_generator.py
489 Bytes
| import pandas as pd | |
| import numpy as np | |
| from faker import Faker | |
| def generate_clean_dataset(n_rows=50, seed=42): | |
| fake = Faker("en_IN") | |
| np.random.seed(seed) | |
| df = pd.DataFrame({ | |
| "customer_id": [f"C-{1000+i}" for i in range(n_rows)], | |
| "name": [fake.name() for _ in range(n_rows)], | |
| "age": np.random.randint(18, 60, n_rows), | |
| "city": [fake.city() for _ in range(n_rows)], | |
| "income": np.random.randint(20000, 100000, n_rows) | |
| }) | |
| return df |