Python Practice › Pandas Programs › Program 8
Is one Series greater?
Write a pandas program to check element-wise whether one Series is greater than another.
Input
[1, 6, 9, 5], [5, 2, 4, 5]
Output
[False, True, True, False]
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, True, True, False]
Learn the concept
New to this topic? Read the lesson, then come back.