Differences between Ibis and Pandas dtypes? #6444
-
Hiya, I've run into a weird behavior when pulling data from an MSSQL DB to Pandas. This is just a snippet of the columns but it illustrates the issue:
Is it an issue with the source SQL datatypes? EDIT: saw this issue #5316, not sure if it might be related, but just in case, my ibis version is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @inigohidalgo ! If you are looking for better type fidelity, you can use [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 |
Beta Was this translation helpful? Give feedback.
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 thatpandas
has a native decimal dtype, so those are going to remainobject
types.If you are looking for better type fidelity, you can use
to_pyarrow()
instead: