Skip to content

Commit 8f436dc

Browse files
committed
Improve error message for category dtype in HDF5, format="fixed" store.
A more explicit (and helpful) error message would have helped me discover sooner that format="table" supported categorical data.
1 parent c5f4d9c commit 8f436dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/io/pytables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ def write_array(self, key, value, items=None):
25172517
transposed = False
25182518

25192519
if com.is_categorical_dtype(value):
2520-
raise NotImplementedError("cannot store a category dtype")
2520+
raise NotImplementedError('Cannot store a category dtype in a HDF5 dataset that uses format="fixed". Use format="table".')
25212521

25222522
if not empty_array:
25232523
value = value.T

0 commit comments

Comments
 (0)