# HF Datasets loading csv

**URL:** <https://discuss.huggingface.co/t/hf-datasets-loading-csv/3434>\
**Category:** Beginners\
**Created:** [January 29, 2021, 5:12pm UTC](https://discuss.huggingface.co/t/hf-datasets-loading-csv/3434 "2021-01-29T17:12:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Buckeyes2019](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@Buckeyes2019](https://discuss.huggingface.co/u/Buckeyes2019)\
**Post date:** [January 29, 2021, 5:12pm UTC](https://discuss.huggingface.co/t/hf-datasets-loading-csv/3434/1 "2021-01-29T17:12:06Z")

</div>

I am attempting to use the following code snippet to load my own custom csv file:

from datasets import load\_dataset  
dataset = load\_dataset(‘csv’, data\_files=[‘my\_file\_1.csv’, ‘my\_file\_2.csv’])

I am replacing [‘my\_file\_1.csv’, ‘my\_file\_2.csv’] with one file name ‘my\_file\_1.csv’. However, I am getting the following error: **TypeError** : expected string or bytes-like object’

Any suggestions?

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [January 30, 2021, 12:24pm UTC](https://discuss.huggingface.co/t/hf-datasets-loading-csv/3434/2 "2021-01-30T12:24:38Z")

</div>

Hi ! Can you post the full stack trace please ?
