Not able to load dataset `TypeError: read_csv() got an unexpected keyword argument 'mangle_dupe_cols'`

#1
by philippelaban - opened

Thanks for your great work!

Very excited to look at the dataset. However currently when I load it (Python 3.9, datasets==2.14.6), I get the following error:

ValueError: Couldn't cast
id: int64
question: string
A: string
B: string
C: string
D: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 885
to
{'id': Value(dtype='int64', id=None), 'question': Value(dtype='string', id=None), 'A': Value(dtype='string', id=None), 'B': Value(dtype='string', id=None), 'C': Value(dtype='string', id=None), 'D': Value(dtype='string', id=None), 'answer': Value(dtype='string', id=None), 'explanation': Value(dtype='string', id=None)}
because column names don't match

The code I used is:

from datasets import load_dataset
dataset = load_dataset("SUFE-AIFLM-Lab/FinEval",name="finance")

Thanks for any help using the dataset!

This is a problem identified here: https://github.com/huggingface/datasets/issues/5744

To resolve this issue, you can try one of the following solutions:

Downgrade pandas: Revert to an earlier version of pandas that still supports the mangle_dupe_cols argument. For example:
pip install pandas==1.5.3

Update datasets: Ensure you have the latest version of the datasets library, as this issue has been addressed in newer releases. You can update it using:
pip install --upgrade datasets

Modify the Code: If you have control over the code, you can remove the mangle_dupe_cols argument from the read_csv function call.

In my case, I used pip install --upgrade datasets and that worked for me.

Sign up or log in to comment