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
lint fixes
  • Loading branch information
jreback committed Dec 10, 2017
commit b2ac7c4d534975eeac49be0ddbfa7e8a3eb89602
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ doc/build/html/index.html
doc/tmp.sv
doc/source/styled.xlsx
doc/source/templates/
env/
env/
2 changes: 1 addition & 1 deletion pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4936,7 +4936,7 @@ def test_categorical_nan_only_columns(self):
'a': ['a', 'b', 'c', np.nan],
'b': [np.nan, np.nan, np.nan, np.nan],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add another column with an array like pd.Series([None]* 3, dtype=object). this might fail your test because the original array was an all-null object type (and no float). but let's see.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, seems to work fine.

'c': [1, 2, 3, 4],
'd': pd.Series([None]* 4, dtype=object)
'd': pd.Series([None] * 4, dtype=object)
})
df['a'] = df.a.astype('category')
df['b'] = df.b.astype('category')
Expand Down
0