Skip to content

Error with nulls in categorical columns #1036

Description

@SuryaThiru

Description

Error thrown when loading penguins dataset:
ValueError: Categorical categories cannot be null

Steps/Code to Reproduce

importopenmlopenml.datasets.get_dataset('penguins')

Expected Results

Dataset loads without issue.

Actual Results

>>>openml.datasets.get_dataset('penguins')
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/openml/datasets/functions.py", line519, inget_datasetdataset=_create_dataset_from_description(
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/openml/datasets/functions.py", line1132, in_create_dataset_from_descriptionreturnOpenMLDataset(
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/openml/datasets/dataset.py", line241, in__init__
) =self._create_pickle_in_cache(data_file)
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/openml/datasets/dataset.py", line526, in_create_pickle_in_cacheX, categorical, attribute_names=self._parse_data_from_arff(data_file)
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/openml/datasets/dataset.py", line457, in_parse_data_from_arffself._unpack_categories(X[column_name], categories_names[column_name])
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/openml/datasets/dataset.py", line686, in_unpack_categoriesraw_cat=pd.Categorical(col, ordered=True, categories=categories)
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/pandas/core/arrays/categorical.py", line304, in__init__dtype=CategoricalDtype._from_values_or_dtype(
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/pandas/core/dtypes/dtypes.py", line273, in_from_values_or_dtypedtype=CategoricalDtype(categories, ordered)
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/pandas/core/dtypes/dtypes.py", line160, in__init__self._finalize(categories, ordered, fastpath=False)
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/pandas/core/dtypes/dtypes.py", line314, in_finalizecategories=self.validate_categories(categories, fastpath=fastpath)
File"/home/suryak/Projects/sandbox/mlgauge/env/lib/python3.8/site-packages/pandas/core/dtypes/dtypes.py", line508, invalidate_categoriesraiseValueError("Categorical categories cannot be null")
ValueError: Categoricalcategoriescannotbenull

Versions

Linux-5.9.16-1-MANJARO-x86_64-with-glibc2.10
Python 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0]
Pandas 1.2.2
NumPy 1.20.1
SciPy 1.6.0
Scikit-Learn 0.24.1
OpenML 0.11.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions