In this python pandas program, we will check whether elements in the series are equal or not.
Steps to solve the program
- Import pandas library as pd.
- Create two series using pd.Series().
- Check whether elements in the series are equal or not using ” == “.
- Print the output.
import pandas as pd
df1 = pd.Series([1,6,9,5])
df2 = pd.Series([5,2,4,5])
print("Equals:")
print(df1 == df2)
Output :
Equals:
0 False
1 False
2 False
3 True
dtype: bool