-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Closed
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.
Milestone
Description
We now have the follow code in the ExtensionArray ops dispatching:
Lines 1169 to 1192 in 2f1b842
# TODO(jreback) | |
# we need to listify to avoid ndarray, or non-same-type extension array | |
# dispatching | |
if is_extension_array_dtype(left): | |
new_left = left.values | |
if isinstance(right, np.ndarray): | |
# handle numpy scalars, this is a PITA | |
# TODO(jreback) | |
new_right = lib.item_from_zerodim(right) | |
if is_scalar(new_right): | |
new_right = [new_right] | |
new_right = list(new_right) | |
elif is_extension_array_dtype(right) and type(left) != type(right): | |
new_right = list(new_right) | |
else: | |
new_right = right | |
else: | |
new_left = list(left.values) | |
new_right = right |
There are a few places where we convert the values to a list, which should be avoided.
Metadata
Metadata
Assignees
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.