0

I have dataframe training_x like this:

>>> print(training_x)
         Pregnancies  Glucose  BloodPressure
762            9       89             62
127            1      118             58
564            0       91             80
375           12      140             82
663            9      145             80
..           ...      ...            ...
763           10      101             76
192            7      159             66
629            4       94             65
559           11       85             74
684            5      136             82
[576 rows x 3 columns]

When I run the following code on training_x dataframe to do StandardScale its values with below code:

from sklearn.preprocessing import StandardScaler

s_c = StandardScaler(with_mean=False)
testing_x = s_c.fit_transform(training_x)
test_x = s_c.transform(testing_x, dt)

I get below exception at the step when doing fit_transform

'NoneType' object is not callable

I don't know what is the issue, the dataframe doesn't had any none or empty values.

  • Welcome to Stack Overflow. Please read [ask] and [mre] and https://ericlippert.com/2014/03/05/how-to-debug-small-programs/, and show a [complete](https://meta.stackoverflow.com/questions/359146) error message, only after first making your best attempt to read and undestand the error message in context. "the dataframe doesn't had any none or empty values" Well, yes - see in the error message where it highlights a line of code? One of the things **mentioned on that line of code** is `None` - one of the expressions that needs to be calculated in that line. – Karl Knechtel Nov 30 '22 at 06:40
  • Please also read through the advice in [I'm getting a TypeError. How do I fix it?](https://stackoverflow.com/questions/73631401). – Karl Knechtel Nov 30 '22 at 06:41

0 Answers0