In this python pandas program, we will elements in the series are greater than other series.
Steps to solve the program
- Import pandas library as pd.
- Create two series using pd.Series().
- Check whether elements in the series are greater than other series 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("Greater than:")
print(df1 > df2)
Output :
Greater than:
0 False
1 True
2 True
3 False
dtype: bool