Answers for "log transform pandas dataframe"

0

log transform pandas dataframe

# Calculate natural logarithm on  'Salary' column 
data['natural_log'] = np.log(data['Salary']) 
data   # Show the dataframe 
# Calculate logarithm to base 2  on 'Salary' column 
data['logarithm_base2'] = np.log2(data['Salary']) 
data   # Show the dataframe
Posted by: Guest on November-24-2020

Code answers related to "log transform pandas dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language