Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to apply class method to pandas python

# Your Class
class YourClass:
  
  def increase(self,value)
  	# Do Something
  	return value + 1

increaser = Yourclass()

df['your column'] = df['new_column'].apply(lambda x: increaser.increase(x))
 
PREVIOUS NEXT
Tagged: #apply #class #method #pandas #python
ADD COMMENT
Topic
Name
4+2 =