MCPcopy
hub / github.com/pandas-dev/pandas / _arith_method

Method _arith_method

pandas/core/base.py:1633–1646  ·  view source on GitHub ↗
(self, other, op)

Source from the content-addressed store, hash-verified

1631 return algorithms.duplicated(arr, keep=keep)
1632
1633 def _arith_method(self, other, op):
1634 res_name = ops.get_op_result_name(self, other)
1635
1636 lvalues = self._values
1637 rvalues = extract_array(other, extract_numpy=True, extract_range=True)
1638 rvalues = ops.maybe_prepare_scalar_for_op(rvalues, lvalues.shape)
1639 rvalues = ensure_wrapped_if_datetimelike(rvalues)
1640 if isinstance(rvalues, range):
1641 rvalues = np.arange(rvalues.start, rvalues.stop, rvalues.step)
1642
1643 with np.errstate(all="ignore"):
1644 result = ops.arithmetic_op(lvalues, rvalues, op)
1645
1646 return self._construct_result(result, name=res_name, other=other)
1647
1648 def _construct_result(self, result, name, other):
1649 """

Callers

nothing calls this directly

Calls 3

_construct_resultMethod · 0.95
extract_arrayFunction · 0.90

Tested by

no test coverage detected