-1

im quiet new in OOP. I would like to access a Method in another Method.

The Code i got so far is shown below:

def get_iso_df(self, iso_filename):
    
    self.iso_filename = iso_filename 
    
    df1 = pd.read_csv(iso_filename)
    df1.columns = ["Error Codes", "ISO", "Sensor"]        
    return df1


def get_errorcode_df(self,filename,codes):
    
    df2 = pd.DataFrame(list(zip(codes)))
    df2.columns = ["Error Codes"]     
    return df2


def compare_df(self):
    df1 = get_iso_df(self, iso_filename)
    df2 = get_errocode_df(self, filename,codes)
    
    new = df1[df1['Error Codes'].isin(df2['Error Codes'])]

    new = new[['Error Codes', 'ISO']]

    print(new.head())

if i run this, i cant access the methods in the compare_df function. name 'get_iso_df' is not defined

I would be grateful for any help.

Greets

Daniel
  • 71
  • 7

0 Answers0