Is one Series greater?

EasyPandas Programs · 8 of 95

Write a pandas program to check element-wise whether one Series is greater than another.

Advertisement
Input
[1, 6, 9, 5], [5, 2, 4, 5]
Output
[False, True, True, False]

Approach

  1. >.

Solution

Python
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]
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More pandas programs

← All 95 Pandas Programs