-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.astype() and Decimal #26731
Comments
There is no first class support in pandas for Decimal objects. You would need to instantiate the Decimal objects within your container and use an an object dtype |
There is however a DecimalArray extension type in our test suite. @TomAugspurger is there a plan to move this into the core at some point? |
Nope. Arrow has a decimal type, that would be the recommended way to store them.
… On Jun 8, 2019, at 06:36, William Ayd ***@***.***> wrote:
There is however a DecimalArray extension type in our test suite. @TomAugspurger is there a plan to move this into the core at some point?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@TomAugspurger Is storing decimals via the Arrow backend possible today with Pandas? Or do you mean that we will be able to do this once we hit Pandas 1.0 and Pandas is using Arrow as a backend? |
No it's not possible today, at least not without writing your own extension type. Pandas 1.0 won't be using Arrow. That will come after. |
is this in your pipeline / realised now ? |
curious about this :) |
Could you perhaps give me an example? As a python/pandas beginner and an "Intermediate" english speaker, I couldn't understand what "instantiate the Decimal objects within your container and use an an object dtype" means. Sorry for my lack of understanding. Thanks in advance. |
same |
Begin from 0.24.0 next code raise exception
Traceback
Problem description
This begin from #21160
After was
pandas/pandas/core/dtypes/common.py
Line 2013 in 0409521
Now
pandas/pandas/core/internals/blocks.py
Line 595 in cb00deb
pandas_dtype()
does not understanddecimal.Decimal
Is it expected behavior or regress?
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.101-26
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
pandas: 0.24.2
pytest: None
pip: 19.1.1
setuptools: 41.0.1
Cython: None
numpy: 1.16.4
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.8.0
pytz: 2019.1
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: