Error in due loop of ufunc does not support argument 0 of type str which has no callable log method

The problem is that your data columns aren’t a numeric type, and numpy.log() expects numeric data. You can convert the data to numeric values using pandas.to_numeric()

mdata = df1[cols].apply(pd.to_numeric)

or by converting the columns to a specific numeric type by using DataFrame.astype()

mdata = df1[cols].astype(float)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top