--- license: cc-by-4.0 language: - en - pt - es size_categories: - n<1K tags: - public-service - government - south-america - brazil - argentina - quality-improvement - merged --- # Merged BR–AR Hourly Public Service Quality Cleaned, merged public-service response dataset for **Brazil (São Paulo state)** and **Argentina (Buenos Aires province)**, produced by a South America regional government public-service improvement program. - **Rows:** 98 (after cleaning; < 100 as required) - **Granularity:** hourly service-call records - **Coverage:** 2026-08-11T03:00:00Z → 2026-08-14T01:15:00Z ## Sources | Source system | Dataset | Country | Rows (raw) | |---|---|---|---| | Brazil / São Paulo | [`toolathon123/sao-paulo-service-calls-hourly`](https://huggingface.co/datasets/toolathon123/sao-paulo-service-calls-hourly) | `BR` | 54 | | Argentina / Buenos Aires | [`toolathon123/buenos-aires-service-calls-hourly`](https://huggingface.co/datasets/toolathon123/buenos-aires-service-calls-hourly) | `AR` | 48 | Raw merged rows: **102** → final rows: **98**. ## Schema | Column | Type | Description | |---|---|---| | `timestamp` | string | Request time, normalized to UTC ISO 8601 (`YYYY-MM-DDTHH:MM:SSZ`) | | `country` | string | `BR` or `AR` | | `city` | string | Lowercase, accent-free, spaces → underscores (e.g. `sao_paulo`, `bahia_blanca`) | | `service_type` | string | Unified category: `health`, `transport`, `water`, `electricity`, `public_safety`, `other` | | `wait_minutes` | int | Wait time in minutes (missing filled with country+service median) | | `status` | string | Response status (`UNKNOWN` where missing) | | `notes` | string | Free-text note (kept from source, PT/ES) | | `source` | string | Provenance dataset id | ## Cleaning & standardization steps 1. **Load** both sources with `datasets.load_dataset`. 2. **Merge** preserving record-level integrity (BR rows first, then AR). 3. **Timestamp unification** — all `timestamp` / `created_at` values converted to UTC ISO 8601 (BR timezone `America/Sao_Paulo`, AR timezone `America/Argentina/Buenos_Aires`). 4. **Country & city standardization** — `country` → `BR`/`AR`; city lowercased, accent-stripped (NFKD), spaces → underscores. 5. **Service-type mapping** — PT/ES taxonomies → `health`/`transport`/`water`/ `electricity`/`public_safety`/`other`. 6. **Missing values** — `wait_minutes` filled with the median per (country, service_type); `status` filled with `UNKNOWN`. 7. **Deduplication** — exact duplicates removed, first occurrence kept. ## Quality checks | Metric | Value | |---|---| | Duplicate records removed | 4 | | Missing `wait_minutes` filled | 21 | | Missing `status` filled | 17 | | Missing values filled (total) | 38 | | Time-format anomalies (non-dominant raw formats) | 16 | | Unparseable timestamps | 0 | | Final rows | 98 (< 100) | ### Hourly continuity (UTC hour buckets) | Country | Min hour (UTC) | Max hour (UTC) | Hours spanned | Hours with calls | Empty hourly slots | |---|---|---|---|---|---| | BR | 2026-08-11T04:00Z | 2026-08-14T01:00Z | 70 | 32 | 38 | | AR | 2026-08-11T03:00Z | 2026-08-14T00:00Z | 70 | 32 | 38 | Service calls are event-based, so not every hour has a call; gaps are expected and reported above for transparency. ## Load ```python from datasets import load_dataset ds = load_dataset("toolathon123/merged-br-ar-hourly-public-service-quality", split="train") ```