Pandas Series: equals() function
Test Pandas objects contain the same elements
The equals() function is used to test whether two Pandas objects contain the same elements.
This function allows two Series or DataFrames to be compared against each other to see if they have the same shape and elements. NaNs in the same location are considered equal. The column headers do not need to have the same type, but the elements within the columns must be the same dtype.
Syntax:
Series.equals(self, other)
Parameters:
Name | Description | Type/Default Value | Required / Optional |
---|---|---|---|
other | The other Series or DataFrame to be compared with the first. | Series or DataFrame | Required |
Returns: bool
True if all elements are the same in both objects, False otherwise.
Example:
Download the Pandas Series Notebooks from here.
Previous: Indicate duplicate Series values
Next: Subset initial periods of Pandas time series
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework