-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: ensuring that np.asarray() simple handles data as objects and doesn't… #22161
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 5 commits
aa672b9
eb2da20
0aa9b53
5c0ecc1
f11b14a
ab06c38
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 |
---|---|---|
|
@@ -134,7 +134,7 @@ def _ensure_data(values, dtype=None): | |
return values, dtype, 'int64' | ||
|
||
# we have failed, return object | ||
values = np.asarray(values) | ||
values = np.asarray(values, dtype=np.object) | ||
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. so we actually should prob use 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. @jreback Actually, pandas.core.dtypes.cast.construct_1d_ndarray_preserving_na would not work for two reasons:
|
||
return ensure_object(values), 'object', 'object' | ||
|
||
|
||
|
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.
is this user visible?
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.
@jreback Only when the user uses
pandas.core.algorithms.isin
directly, then the wrong behavior from #22160 is fixed. There is however no difference ifisin
is used viaSeries
orIndex
- the values are already in anp.array
and thus the bug ins't triggered.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.
ok , this is an internal, routine, ok removing this whatsnew note.