Skip to content

WIP: Use dispatch_to_series for combine_const #22751

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
whitespace fixup
  • Loading branch information
jbrockmendel committed Sep 18, 2018
commit d6d62e73ddba3791ee070ce8db068246a4e7e9dc
3 changes: 2 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4872,7 +4872,8 @@ def _combine_const(self, other, func, errors='raise', try_cast=True):
right = np.broadcast_to(other, self.shape)
return ops.dispatch_to_series(self, right, func)

elif (np.ndim(other) == 1 and isinstance(other, (tuple,np.ndarray)) and
elif (np.ndim(other) == 1 and
isinstance(other, (tuple, np.ndarray)) and
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test for that goes through this path with a tuple, but none with a list. IIRC, no tests fail if list is included here.

Similarly, in the case above, only np.ndarray cases are tested. Should tuple and/or list be allowed?

len(other) == len(self) != len(self.columns)):
# tests include at least 1 tuple in this case
right = np.array(other)[:, None]
Expand Down