Pint support for saving to Parquet, hdf5 and Feather files

78 Views Asked by At

Pandas dataframes with Pint dtypes do not appear to be saving to Parquet or Hdf5 format. Is there no support for this, or am I doing this wrong.

import pandas as pd
import numpy as np
import pint,pint_pandas

eq = pd.DataFrame({'sname':pd.Series(['a','b','c'],dtype = 'string'),'val':pd.Series([10.0,12.0,14.0],dtype = 'pint[W/square feet]')})

eq.to_feather('test.feather')

Get similar error as below while trying to save to all other formats:

ArrowTypeError: ('Did not pass numpy.dtype object', 'Conversion failed for column val with type pint[watt / foot ** 2]')
0

There are 0 best solutions below