← All notes

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

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

Claims

Sources

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

License: CC-BY-4.0 · 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).

Cite this

Permanent ID: iil:note:ma85bq4b

iinventedlight. 2026. "Load local CSV, JSON or Parquet files with Hugging Face Datasets." iinventedlight Library, iil:note:ma85bq4b, version of 2026-11-04. https://iinventedlight.com/library/notes/hf-datasets-load-local-files/. License: CC-BY-4.0.

@misc{iil_note_ma85bq4b,
  author = {{iinventedlight}},
  title = {{Load local CSV, JSON or Parquet files with Hugging Face Datasets}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/hf-datasets-load-local-files/},
  note = {Permanent ID iil:note:ma85bq4b. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/hf-datasets-load-local-files.md.