Skip to content

Commit 8726b6c

Browse files
committed
Add comment as requested by Jan
1 parent d8e678f commit 8726b6c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

openml/datasets/dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ def _unpack_categories(series, categories):
408408
col.append(categories[int(x)])
409409
except (TypeError, ValueError):
410410
col.append(np.nan)
411+
# We require two lines to create a series of categories as detailed here:
412+
# https://pandas.pydata.org/pandas-docs/version/0.24/user_guide/categorical.html#series-creation # noqa E501
411413
raw_cat = pd.Categorical(col, ordered=True, categories=categories)
412414
return pd.Series(raw_cat, index=series.index, name=series.name)
413415

openml/runs/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import OrderedDict
22
import pickle
33
import time
4-
from typing import Any, IO, TextIO
4+
from typing import Any, IO, TextIO # noqa F401
55
import os
66

77
import arff

0 commit comments

Comments
 (0)