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

Function get_objs_combined_axis

pandas/core/indexes/api.py:63–92  ·  view source on GitHub ↗

Extract combined index: return intersection or union (depending on the value of "intersect") of indexes on given axis, or None if all objects lack indexes (e.g. they are numpy arrays). Parameters ---------- objs : list Series or DataFrame objects, may be mix of the

(
    objs,
    intersect: bool = False,
    axis: Axis = 0,
    sort: bool | lib.NoDefault = True,
)

Source from the content-addressed store, hash-verified

61
62
63def get_objs_combined_axis(
64 objs,
65 intersect: bool = False,
66 axis: Axis = 0,
67 sort: bool | lib.NoDefault = True,
68) -> Index:
69 """
70 Extract combined index: return intersection or union (depending on the
71 value of "intersect") of indexes on given axis, or None if all objects
72 lack indexes (e.g. they are numpy arrays).
73
74 Parameters
75 ----------
76 objs : list
77 Series or DataFrame objects, may be mix of the two.
78 intersect : bool, default False
79 If True, calculate the intersection between indexes. Otherwise,
80 calculate the union.
81 axis : {0 or 'index', 1 or 'outer'}, default 0
82 The axis to extract indexes from.
83 sort : bool, default True
84 Whether the result index should come out sorted or not. NoDefault
85 use for deprecation in GH#57335.
86
87 Returns
88 -------
89 Index
90 """
91 obs_idxes = [obj._get_axis(axis) for obj in objs]
92 return _get_combined_index(obs_idxes, intersect=intersect, sort=sort)
93
94
95def _get_distinct_objs(objs: list[Index]) -> list[Index]:

Callers 4

crosstabFunction · 0.90
_get_resultFunction · 0.90
new_axesFunction · 0.90

Calls 2

_get_combined_indexFunction · 0.85
_get_axisMethod · 0.80

Tested by

no test coverage detected