Is your feature request related to a problem?
I would like to be able to save the following dataframes: - list of intervals:
import pandas as pd
df = pd.DataFrame({"x": [[pd.Interval(0, 1), pd.Interval(3, 4)]]})
df.to_parquet("test.parquet")
- IntervalArray
import pandas as pd
df = pd.DataFrame({"x": [pd.arrays.IntervalArray.from_tuples([(0, 1), (2, 3)]), ]})
df.to_parquet("test.parquet")
However, currently both cases fail with:
pyarrow.lib.ArrowInvalid: ('Could not convert (0, 1] with type pandas._libs.interval.Interval: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column x with type object')
pyarrow.lib.ArrowInvalid: ('Could not convert <IntervalArray>\n[(0, 1], (2, 3]]\nLength: 2, closed: right, dtype: interval[int64] with type IntervalArray: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column x with type object')
Describe the solution you'd like
[this should provide a description of the feature request, e.g. "DataFrame.foo
should get a new parameter bar
that [...]", try to write a docstring for the desired feature]
API breaking implications
None
pd.show_versions()
INSTALLED VERSIONS
------------------
commit : None
python : 3.7.4.final.0
python-bits : 64
OS : Linux
OS-release : 5.6.14-arch1-1
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : de_DE.UTF-8
LOCALE : de_DE.UTF-8
pandas : 1.0.4
numpy : 1.17.2
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.2
setuptools : 41.0.1
Cython : 0.29.13
pytest : 5.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.15.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.17.1
pytables : None
pytest : 5.0.1
pyxlsb : None
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : None
tabulate : 0.8.7
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None