africa_cod_rainfall / README.md
THUgewu's picture
Copy from wangdx25/africa_cod_rainfall
c6eee15 verified
|
Raw History Blame Contribute Delete
4.35 kB
metadata
license: cc-by-4.0
task_categories:
  - tabular-classification
  - tabular-regression
language:
  - en
tags:
  - tsfile
  - timeseries
  - time-series
  - africa
  - electric-sheep-africa
  - open-data
  - metadata-backed
  - climate-environment
  - parquet
  - tabular
  - text
  - humanitarian
  - hdx
  - climate-weather
  - environment
  - cod
  - climate
  - weather
  - rainfall
  - format:tsfile
pretty_name: >-
  Democratic Republic of the Congo: Rainfall Indicators at Subnational Level |
  Africa (original) (TsFile)
size_categories:
  - 100K<n<1M
configs:
  - config_name: default
    data_files:
      - split: train
        path: africa_cod_rainfall.tsfile

Democratic Republic of the Congo: Rainfall Indicators at Subnational Level | Africa (original) (TsFile)

Apache TsFile version of electricsheepafrica/africa-cod-rainfall-subnational.

Overview

This dataset is part of the Electric Sheep Africa catalog on Hugging Face. It is indexed for African data discovery with standardized metadata, loading guidance, provenance notes, and analyst-oriented context.

  • Tables: 1 TsFile table(s), 402,610 rows in total.
    • africa_cod_rainfall: 402,610 rows, 1981-01-01 00:00:00 鈫?2026-04-01 00:00:00.246000 (UTC)

Schema (TsFile structure)

africa_cod_rainfall.tsfile

  • Time (INT64, milliseconds) 鈥?the source date column.
  • TAG: none 鈥?the table is stored as a single device.
  • FIELD (16): adm_level (int64), adm_id (int64), pcode (string), n_pixels (double), rfh (double), rfh_avg (double), r1h (double), r1h_avg (double), r3h (double), r3h_avg (double), rfq (double), r1q (double), r3q (double), version (string), esa_source (string), esa_processed (string)

Conversion notes

  • One TsFile per source table (1 tables). Tables whose source carries several entities per file are stored as one device per entity.
  • Time = the table's own clock column as INT64 milliseconds. The clock columns used here are date.
  • No column is dropped. Rows that share a timestamp inside one device are ordered by a 1 ms step in stable source order, so calendar columns keep their exact day.

Usage

Read this dataset with the Java SDK. It is written with the zstd compressor. The Apache TsFile Java SDK reads every compressor, but the Python SDK (pip install tsfile) implements only UNCOMPRESSED, SNAPPY, GZIP and LZ4; opening this file with it yields no rows.

Read a converted file with the Apache TsFile Java SDK (org.apache.tsfile:tsfile):

import org.apache.tsfile.file.metadata.IDeviceID;
import org.apache.tsfile.read.TsFileReader;
import org.apache.tsfile.read.TsFileSequenceReader;
import org.apache.tsfile.read.common.Path;
import org.apache.tsfile.read.expression.QueryExpression;
import org.apache.tsfile.read.query.dataset.QueryDataSet;
import org.apache.tsfile.write.schema.MeasurementSchema;

import java.util.ArrayList;
import java.util.List;

String path = "africa_cod_rainfall.tsfile";
try (TsFileSequenceReader sequenceReader = new TsFileSequenceReader(path);
     TsFileReader reader = new TsFileReader(sequenceReader)) {
    // Devices are enumerated as IDeviceID objects. Tables with TAG columns
    // have multi-segment device ids that cannot be rebuilt from their string
    // form, so always use getAllDevices() rather than getAllDeviceIds().
    for (IDeviceID device : sequenceReader.getAllDevices()) {
        List<Path> paths = new ArrayList<>();
        for (MeasurementSchema schema : reader.getMeasurement(device)) {
            String name = schema.getMeasurementName();
            if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) {
                paths.add(new Path(device, name, true));
            }
        }
        QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null));
        while (dataSet.hasNext()) {
            System.out.println(dataSet.next());
        }
    }
}

Source & license