-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Add the decimal.Decimal type to infer_dtypes (#15690) #16426
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
Changes from 1 commit
bc15e85
e7e67e8
b291b62
024feac
cc9ac39
6f158cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import collections | ||
import re | ||
from datetime import datetime, date, timedelta, time | ||
from decimal import Decimal | ||
import numpy as np | ||
import pytz | ||
import pytest | ||
|
@@ -462,6 +463,11 @@ def test_floats(self): | |
result = lib.infer_dtype(arr) | ||
assert result == 'floating' | ||
|
||
def test_decimals(self): | ||
arr = np.array([Decimal(1), Decimal(2), Decimal(3)]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment with a link to the github issue? (#15690) |
||
result = lib.infer_dtype(arr) | ||
assert result == 'decimal' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, could you add a test with a mix of Decimal and non-decimal (like floats) and make sure that the return is |
||
def test_string(self): | ||
pass | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls update the doc-string & add an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6f158cb