pandas 1.4.2

Parameters
compare(self, other, align_axis: 'Axis' = 1, keep_shape: 'bool_t' = False, keep_equal: 'bool_t' = False)
versionadded

Parameters

other : Series/DataFrame

Object to compare with.

align_axis : {0 or 'index', 1 or 'columns'}, default 1

Determine which axis to align the comparison on.

  • 0,or'index'

    0, or 'index'

  • 1,or'columns'

    1, or 'columns'

keep_shape : bool, default False

If true, all rows and columns are kept. Otherwise, only the ones with different values are kept.

keep_equal : bool, default False

If true, the result keeps values that are equal. Otherwise, equal values are shown as NaNs.

Compare to another Series/DataFrame and show the differences.

Examples

See :

Local connectivity graph

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


File: /pandas/core/generic.py#8624
type: <class 'function'>
Commit: