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

Function get_op_result_name

pandas/core/ops/common.py:92–111  ·  view source on GitHub ↗

Find the appropriate name to pin to an operation result. This result should always be either an Index or a Series. Parameters ---------- left : {Series, Index} right : object Returns ------- name : object Usually a string

(left, right)

Source from the content-addressed store, hash-verified

90
91
92def get_op_result_name(left, right):
93 """
94 Find the appropriate name to pin to an operation result. This result
95 should always be either an Index or a Series.
96
97 Parameters
98 ----------
99 left : {Series, Index}
100 right : object
101
102 Returns
103 -------
104 name : object
105 Usually a string
106 """
107 if isinstance(right, (ABCSeries, ABCIndex)):
108 name = _maybe_match_name(left, right)
109 else:
110 name = left.name
111 return name
112
113
114def _maybe_match_name(a, b):

Callers 3

_wrap_setop_resultMethod · 0.90
_convert_can_do_setopMethod · 0.90

Calls 1

_maybe_match_nameFunction · 0.85

Tested by

no test coverage detected