equals(self, other: 'Any') -> 'bool'
The things that are being compared are:
The elements inside the Index object.
The order of the elements inside the Index object.
The other object to compare against.
True if "other" is an Index and it has the same elements and order as the calling index; False otherwise.
Determine if two Index object are equal.
>>> idx1 = pd.Index([1, 2, 3])This example is valid syntax, but we were not able to check execution
... idx1 Int64Index([1, 2, 3], dtype='int64')
>>> idx1.equals(pd.Index([1, 2, 3])) True
The elements inside are compared
This example is valid syntax, but we were not able to check execution>>> idx2 = pd.Index(["1", "2", "3"])This example is valid syntax, but we were not able to check execution
... idx2 Index(['1', '2', '3'], dtype='object')
>>> idx1.equals(idx2) False
The order is compared
This example is valid syntax, but we were not able to check execution>>> ascending_idx = pd.Index([1, 2, 3])This example is valid syntax, but we were not able to check execution
... ascending_idx Int64Index([1, 2, 3], dtype='int64')
>>> descending_idx = pd.Index([3, 2, 1])This example is valid syntax, but we were not able to check execution
... descending_idx Int64Index([3, 2, 1], dtype='int64')
>>> ascending_idx.equals(descending_idx) False
The dtype is not compared
This example is valid syntax, but we were not able to check execution>>> int64_idx = pd.Int64Index([1, 2, 3])This example is valid syntax, but we were not able to check execution
... int64_idx Int64Index([1, 2, 3], dtype='int64')
>>> uint64_idx = pd.UInt64Index([1, 2, 3])This example is valid syntax, but we were not able to check execution
... uint64_idx UInt64Index([1, 2, 3], dtype='uint64')
>>> int64_idx.equals(uint64_idx) TrueSee :
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them