If I have the below class, is there a way to pass a variable that was defined in the outer class __init__
constructor into the inner class constructor in the inner class?
class Outer:
def __init__(self, df):
self.df = df
class Inner:
## Looking to pass the df into this class
I stumbled across this solution but I wanted to know if there was a simpler solution?
I also came across this solution but with this, I'd have to insert the df when calling the inner class. Is there a way to avoid this whereby if its initialised in the outer class, I can automatically retrieve it when I call the inner class or is this unavoidable?