I have a dict of objects.
data = [{'a': 'qwerty', 'b': 123}]
I create a dataframe:
df = pd.DataFrame(data)
now I want to persist it:
df.to_hdf(filename, 'book', table=True, mode='a', append=True)
now I want to persist another batch of data that slightly longer in size:
data = [{'a': 'qwerty2', 'b': 123}]
df = pd.DataFrame(data)
df.to_hdf(filename, 'book', table=True, mode='a', append=True)
it fails with error:
ValueError: Trying to store a string with len [7] in [values_block_2] column but
this column has a limit of [6]!
Consider using min_itemsize to preset the sizes on these columns
It basically works when only when I keep the size of column the same size but if it is different I am getting the error above. How do I make pandas to work with any size of the string?