8000 BUG: Categorical data fails to load from hdf when all columns are NaN by ssche · Pull Request #18652 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Categorical data fails to load from hdf when all columns are NaN #18652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Dec 10, 2017
Prev Previous commit
Next Next commit
Removed trailing whitespace
  • Loading branch information
ssche committed Dec 6, 2017
commit 8540a4afd71edaf5a3ff1bf7653037d6a60c8c12
2 changes: 1 addition & 1 deletion pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ def convert(self, values, nan_rep, encoding):
mask = isna(categories)
if mask.any():
categories = categories[~mask]
codes[codes != -1] -= mask.astype(int).cumsum().values
codes[codes != -1] -= mask.astype(int).cumsum().values

self.data = Categorical.from_codes(codes,
categories=categories,
Expand Down
0