'Can't the 'apply' function call a variable in a class?

class PRINTPANDAS(object):
    def __int__(self):
        self.text = 1
    def printText(self,pdData):
        print(self.text,pdData[0])
………………
    def Run(self):
        pandasData.apply(self.printText,axis=1) 
AttributeError: 'PRINTPANDAS' object has no attribute 'text'

Can't the apply function call a variable?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source