Skip to content

Differences between Ibis and Pandas dtypes? #6444

Answered by gforsyth
inigohidalgo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @inigohidalgo !
We haven't yet moved over to the newer pandas dtypes when we return a pandas dataframe -- that's why you're seeing object for the string columns. I don't believe that pandas has a native decimal dtype, so those are going to remain object types.

If you are looking for better type fidelity, you can use to_pyarrow() instead:

[ins] In [14]: t.schema()
Out[14]: 
ibis.Schema {
  a  decimal(20, 5)
  b  string
}

[ins] In [15]: t.schema().to_pandas()
Out[15]: [('a', dtype('O')), ('b', dtype('O'))]

[ins] In [16]: t.schema().to_pyarrow()
Out[16]: 
a: decimal128(20, 5)
b: string

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by inigohidalgo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants