Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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 
Comment

PREVIOUS NEXT
Code Example
Python :: extract zip file python 
Python :: strftime python 
Python :: import settings 
Python :: python get num classes from label encoder 
Python :: length ofarray in ptyon 
Python :: python convert xd8 to utf8 
Python :: how to create file using python cat command 
Python :: get from time secs and nsecs 
Python :: keras ensure equal class representation during traingin 
Python :: get current file location 
Python :: python change file location 
Python :: matplotlib plot 
Python :: how to create a tkinter window 
Python :: pylint: disable=unused-argument 
Python :: python get words between two words 
Python :: graphics in python in repl 
Python :: how to print me me big boy python 
Python :: pandas filter and change value 
Python :: pandas series select first value 
Python :: printing hollow triangle in python 
Python :: python seaborn heatmap decrease annot size 
Python :: create numpy table with random values in range 
Python :: python code for system of odes 
Python :: python execute bat file 
Python :: django rest framework delete file 
Python :: how to create virtual environment 
Python :: join pyspark stackoverflow 
Python :: pair plot python 
Python :: python square root of large number 
Python :: python opencv create new image 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =