---
title: "Load local CSV, JSON or Parquet files with Hugging Face Datasets"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/hf-datasets-load-local-files.md
source_license: "Apache-2.0 (huggingface/datasets docs); restated in our own words"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Hugging Face (Datasets docs), Load · Hugging Face, Apache-2.0 (huggingface/datasets docs); Hugging Face (Datasets docs), Load tabular data · Hugging Face, Apache-2.0 (huggingface/datasets docs)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run; only the fetched Hugging Face documentation pages were read."
category: huggingface-datasets
topic_area: "datasets: loading"
tags: huggingface, datasets, csv, local-files
sources:
  - id: S1
    title: "Load · Hugging Face"
    publisher: Hugging Face (Datasets docs)
    url: https://huggingface.co/docs/datasets/loading
    accessed: 2026-11-04
    license: "Apache-2.0 (huggingface/datasets docs)"
  - id: S2
    title: "Load tabular data · Hugging Face"
    publisher: Hugging Face (Datasets docs)
    url: https://huggingface.co/docs/datasets/tabular_load
    accessed: 2026-11-04
    license: "Apache-2.0 (huggingface/datasets docs)"
---
# Load local CSV, JSON or Parquet files with Hugging Face Datasets

## Short answer
Use the generic builder name plus `data_files`: `load_dataset("csv", data_files="my.csv")`. Pass a list for several files, or a dict to map files to splits. URLs work too. For a DataFrame already in memory, use `Dataset.from_pandas(df)`. [S1][S2]

## Example
```python
ds = load_dataset("csv", data_files={"train": ["a.csv", "b.csv"], "test": "t.csv"})
```

## Claims
- id: C1
  claim: Data can be local, on GitHub, or in memory.
  source: S1
  evidence: "they can be on your local machine's disk, in a Github repository"
- id: C2
  claim: CSV is loaded with the generic csv builder.
  source: S2
  evidence: "by specifying the generic csv dataset builder name in the load_dataset() method"
- id: C3
  claim: Files can be mapped to train and test splits.
  source: S2
  evidence: "You can also map specific CSV files to the train and test splits:"
- id: C4
  claim: from_pandas loads from DataFrames.
  source: S2
  evidence: "also supports loading datasets from Pandas DataFrames with the from_pandas() method"

## Sources
- [S1] Load · Hugging Face. Hugging Face (Datasets docs). https://huggingface.co/docs/datasets/loading . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-04.
- [S2] Load tabular data · Hugging Face. Hugging Face (Datasets docs). https://huggingface.co/docs/datasets/tabular_load . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
