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

Function _validate_operand

pandas/core/reshape/merge.py:3055–3065  ·  view source on GitHub ↗
(obj: DataFrame | Series)

Source from the content-addressed store, hash-verified

3053
3054
3055def _validate_operand(obj: DataFrame | Series) -> DataFrame:
3056 if isinstance(obj, ABCDataFrame):
3057 return obj
3058 elif isinstance(obj, ABCSeries):
3059 if obj.name is None:
3060 raise ValueError("Cannot merge a Series without a name")
3061 return obj.to_frame()
3062 else:
3063 raise TypeError(
3064 f"Can only merge Series or DataFrame objects, a {type(obj)} was passed"
3065 )
3066
3067
3068def _items_overlap_with_suffix(

Callers 2

mergeFunction · 0.85
__init__Method · 0.85

Calls 1

to_frameMethod · 0.45

Tested by

no test coverage detected