Python Practice › Pandas Programs › Program 7
Are Series elements equal?
Write a pandas program to compare two Series element by element.
Input
[1, 6, 9, 5], [5, 2, 4, 5]
Output
[False, False, False, True]
Approach
==.
Solution
import pandas as pda, b = pd.Series([1, 6, 9, 5]), pd.Series([5, 2, 4, 5])print((a == b).tolist())Output
[False, False, False, True]
Learn the concept
New to this topic? Read the lesson, then come back.