Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
HDFStore.append fails when appending dataframe with empty string column for which min_itemsize < 8 #12242
Reproduced as follows:
Does not raise unless all values in a column are empty strings. A workaround is to set min_itemsize to 8 or higher.
So it looks like this comes from
In : np.array([b'', b''], dtype='S0') Out: array([b'', b''], dtype='|S1') # length 1
Looks like a numpy bug maybe? Either way, we can work around by changing this line to
itemsize = max(1, lib.max_len_string_array(com._ensure_object(data.ravel())))
@amcpherson thanks for the report. Are you interested in submitting a Pull Request with that fix and a test?
i can do a pull request, cant guarantee how soon though