Answers for "pandas reciprocal"

3

pandas reciprocal

import numpy as np
import pandas as pd
#There are two ways to get the reciprocal of a dataframe:
#First way:
df.rdiv(1)
#Second way:
np.reciprocal(df) #If you want the reciprocal of just one row then use .iloc[]
                  #to do that
Posted by: Guest on September-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language