File size: 2,392 Bytes
281c34f
 
 
 
 
 
 
a50a8dc
 
 
 
281c34f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---

license: other
tags:
- csv

configs:
  - config_name: cleaned
    data_files:
      - split: train
        path: cleaned.csv

---

  # Repair Data (Cleaned Preview)

  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
  csv_repair.py to standardize types, trim whitespace, harmonize null-like tokens, and optionally split a location column into city and country. City names
  can be made country-specific using a real city catalog built from GeoNames.

  ## Files

  - cleaned.csv — primary data file targeted for preview.
  - Other helper scripts and reports are included for reproducibility (e.g., csv_repair.py, extract_countries.py, geonames_fetch.py, JSON mappings under
    report/).

  If cleaned.csv lives in a subfolder, update the front‑matter viewer.default_path to that path (e.g., report/cleaned.csv).

  ## How It Was Built

  - Analysis and cleaning: csv_repair.py (trims strings, standardizes boolean‑like values, parses dates where feasible, detects outliers, suggests column
    fixes).
  - Location repair (optional): splits location into city and country.
      - Real city mode: --location-mode real --cities-json report/cities_by_country.json.
  - GeoNames data: geonames_fetch.py builds countries.json, provinces_by_country.json, and cities_by_country.json.

  Example command to generate cleaned.csv:

  python csv_repair.py \
    -i HR_Data_Clean_2020_2025.csv \
    -o report \
    --cleaned-csv cleaned.csv \
    --fix-location \
    --location-mode real \
    --cities-json report/cities_by_country.json

  ## Load Examples

  - With datasets:

  from datasets import load_dataset
  ds = load_dataset("savedata101/repair_data", data_files={"train": "cleaned.csv"})
  print(ds["train"])

  - With pandas (direct URL to main branch):

  import pandas as pd
  url = "https://huggingface.co/datasets/savedata101/repair_data/resolve/main/cleaned.csv"
  df = pd.read_csv(url)
  print(df.head())

  ## Notes

  - Preview focuses on cleaned.csv via the dataset card front‑matter.
  - If your cleaned file path changes, keep viewer.default_path in sync.
  - Large original CSVs may be excluded from preview but remain accessible in the repo.

  ## License

  Data license is set to other as a placeholder. Please update to the appropriate license for your data.