Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
|
| 3 |
+
license: other
|
| 4 |
+
tags:
|
| 5 |
+
- csv
|
| 6 |
+
- data-cleaning
|
| 7 |
+
- geonames
|
| 8 |
+
- hr-data
|
| 9 |
+
|
| 10 |
+
configs:
|
| 11 |
+
- config_name: main_data
|
| 12 |
+
data_files:
|
| 13 |
+
- split: train
|
| 14 |
+
path: "cleaned.csv"
|
| 15 |
+
sep: ","
|
| 16 |
+
default: true
|
| 17 |
+
- config_name: original_data
|
| 18 |
+
data_files: "HR_Data_Clean_2020_2025.csv"
|
| 19 |
+
sep: ","
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Repair Data (Cleaned Preview)
|
| 24 |
+
|
| 25 |
+
This dataset publishes the contents of the repair_data folder, with the dataset UI preview focused on cleaned.csv. The cleaned file is produced with
|
| 26 |
+
csv_repair.py to standardize types, trim whitespace, harmonize null-like tokens, and optionally split a location column into city and country. City names
|
| 27 |
+
can be made country-specific using a real city catalog built from GeoNames.
|
| 28 |
+
|
| 29 |
+
## Files
|
| 30 |
+
|
| 31 |
+
- cleaned.csv — primary data file targeted for preview.
|
| 32 |
+
- Other helper scripts and reports are included for reproducibility (e.g., csv_repair.py, extract_countries.py, geonames_fetch.py, JSON mappings under
|
| 33 |
+
report/).
|
| 34 |
+
|
| 35 |
+
If cleaned.csv lives in a subfolder, update the front‑matter viewer.default_path to that path (e.g., report/cleaned.csv).
|
| 36 |
+
|
| 37 |
+
## How It Was Built
|
| 38 |
+
|
| 39 |
+
- Analysis and cleaning: csv_repair.py (trims strings, standardizes boolean‑like values, parses dates where feasible, detects outliers, suggests column
|
| 40 |
+
fixes).
|
| 41 |
+
- Location repair (optional): splits location into city and country.
|
| 42 |
+
- Real city mode: --location-mode real --cities-json report/cities_by_country.json.
|
| 43 |
+
- GeoNames data: geonames_fetch.py builds countries.json, provinces_by_country.json, and cities_by_country.json.
|
| 44 |
+
|
| 45 |
+
Example command to generate cleaned.csv:
|
| 46 |
+
|
| 47 |
+
python csv_repair.py \
|
| 48 |
+
-i HR_Data_Clean_2020_2025.csv \
|
| 49 |
+
-o report \
|
| 50 |
+
--cleaned-csv cleaned.csv \
|
| 51 |
+
--fix-location \
|
| 52 |
+
--location-mode real \
|
| 53 |
+
--cities-json report/cities_by_country.json
|
| 54 |
+
|
| 55 |
+
## Load Examples
|
| 56 |
+
|
| 57 |
+
- With datasets:
|
| 58 |
+
|
| 59 |
+
from datasets import load_dataset
|
| 60 |
+
ds = load_dataset("savedata101/repair_data", data_files={"train": "cleaned.csv"})
|
| 61 |
+
print(ds["train"])
|
| 62 |
+
|
| 63 |
+
- With pandas (direct URL to main branch):
|
| 64 |
+
|
| 65 |
+
import pandas as pd
|
| 66 |
+
url = "https://huggingface.co/datasets/savedata101/repair_data/resolve/main/cleaned.csv"
|
| 67 |
+
df = pd.read_csv(url)
|
| 68 |
+
print(df.head())
|
| 69 |
+
|
| 70 |
+
## Notes
|
| 71 |
+
|
| 72 |
+
- Preview focuses on cleaned.csv via the dataset card front‑matter.
|
| 73 |
+
- If your cleaned file path changes, keep viewer.default_path in sync.
|
| 74 |
+
- Large original CSVs may be excluded from preview but remain accessible in the repo.
|
| 75 |
+
|
| 76 |
+
## License
|
| 77 |
+
|
| 78 |
+
Data license is set to other as a placeholder. Please update to the appropriate license for your data.
|