-
Notifications
You must be signed in to change notification settings - Fork 42
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
Constructor path unexpectedly changes outcome #205
Comments
you're seeing the effects of the underlying data stored in different ways. you can view this with If I'm understanding correctly, you're expecting all these to behave the same. Previously the data was converted to float so ints and other types could not be stored, but prevented these issues. However people wanted to store other dtypes. including the data array dtype, eg 'dtype: pint[m][int]' would help with these issues (at least make it clearer as to why its behaving odd), but hasn't been as necessary so far. |
In the Pandas world there's a long-running thread about resolving NA vs. np.nan for null values. I did quite a lot of work for a long time on a branch where I used NA as the na_value instead of np.nan, and it works great (and I believe also works for both Float64 and Int64). To make this work, Pint simply needs to cast int64 arrays to Int64 and float64 to Float64. I reversed that when I started working with adding |
Example
Inconsistency 1: representation of
NaN
.The value of the
NaN
element at index position 1 changes slightly between1
and2
/3
:Inconsistency 2: impact of
int
Also, getting the magnitude delivers inconsistent results. Surprisingly, the difference here is between
1
/2
and3
:Notice how the latter is a series of objects.
Versions
Tested with following versions of (pandas, pint, pint-pandas):
(1.5.3, 0.22, 0.4)
(1.5.3, 0.22, 0.5)
(2.1.0, 0.22, 0.5)
All give the same result
The text was updated successfully, but these errors were encountered: