Imputing Missing Values

Hi @ASHISH_17 @pavscorp1911,

I am facing issues in running this code.

    if pd.isnull(x['LoanAmount']):
        return table[x['Education']][x['Self_Employed']]
    else:
        return x['LoanAmount']

Final allocation

train_data[‘LoanAmount’] = train_data.apply(lambda x : format(fill(x),’.2f’),axis=1)

I am getting an error which says
“KeyError: (‘Graduate’, ‘occurred at index 0’)”

@ASHISH_17 Could you tell me how did you change it by adding table.loc and removing 2f

Please help.