When normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

488    Asked by AshishSinha in Python , Asked on Apr 17, 2021

for i in cnames:

    print(i)

    df_csv[i] = (df_csv[i] - min(df_csv[i]))/(max(df_csv[i]) - min(df_csv[i]))

here df_csv is my dataset name

Answered by Ashish Sinha

This is because you incorrectly normalizing, you need to do it like this:

for i in names:

      print(i)
      c[i] = (c[i] - c[i].min())/(c[i].max() - c[i].min())

Note: TypeError: 'float' object is not callable generally generates when values accidentally assigned to built-in function



Your Answer

Interviews

Parent Categories