Program to divide two series

In this python pandas program, we will divide two series using pandas library.

Steps to solve the program
  1. Import pandas library as pd.
  2. Create two series using pd.Series().
  3. Now divide the two series using the ” / ” operator.
  4. Print the output.
				
					import pandas as pd
df1 = pd.Series([1,6,9,5])
df2 = pd.Series([5,2,4,5])
print(df1/df2)
				
			

Output :

				
					0    0.20
1    3.00
2    2.25
3    1.00
dtype: float64
				
			

multiply two series

check whether elements in the series are equal or not

Leave a Comment