Jun-28-2022, 02:15 PM
(This post was last modified: Jun-28-2022, 02:22 PM by Led_Zeppelin.)
I get the following response when I run some python code and use
StandardScaler
My question is how I fix so I can see at least the first 5 lines of the new dataframe that has been scaled.
Right now, I can see no dataframe. I just want to see the first five lines (hence, df.head())
so, I can see that the Standard Scaler did its work.
Thanks in advance.
Respectfully,
LZ
StandardScaler
scaler=StandardScaler() df=scaler.fit_transform(df)
Error:---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [42], in <cell line: 1>()
----> 1 df.head()
AttributeError: 'numpy.ndarray' object has no attribute 'head'
I think that I know what the error is. Numpy cannot be indexed or something like that. My question is how I fix so I can see at least the first 5 lines of the new dataframe that has been scaled.
Right now, I can see no dataframe. I just want to see the first five lines (hence, df.head())
so, I can see that the Standard Scaler did its work.
Thanks in advance.
Respectfully,
LZ