pandas.Series.compare
pandas 3.1.1 · Series and accessors · method
Display the differences between two equally labeled objects side by side.
Call syntax
Series.compare(
other,
align_axis=1,
keep_shape=False,
keep_equal=False,
result_names=('self', 'other'),
)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
other |
Required Positional or keyword |
Series Supply the second object or value used in the operation. |
align_axis |
Optional Positional or keyword Default 1 |
{0 or 'index', 1 or 'columns'} |
keep_shape |
Optional Positional or keyword Default False |
bool |
keep_equal |
Optional Positional or keyword Default False |
bool |
result_names |
Optional Positional or keyword Default ('self', 'other') |
tuple |
Returns
Series or DataFrame