0

hey i try to scale my df with different datatypes. I already changed the float64 into integer64 format.. but it keeps giving me the error:

TypeError: The DTypes <class 'numpy.dtype[datetime64]'> and <class 'numpy.dtype[int64]'> do not have a common DType. For example they cannot be stored in a single array unless the dtype is object..

the dataset consists of: [Columns with DType][1]

I want to scale the data with this Code:

scaler = StandardScaler()

df_scaled = scaler.fit_transform(df) df_scaled.shape

as soon a i run it it gives me the error [1]: https://i.stack.imgur.com/EllTf.png

  • Does the error come when you attempt to convert the float64 column datatype to integer64? – rob0tst0p Mar 14 '22 at 18:19
  • no the error starts when i do the following (edited the code) – Nine x Seven Prod. Mar 14 '22 at 18:20
  • Have you viewed this answer: https://stackoverflow.com/questions/35723472/how-to-use-sklearn-fit-transform-with-pandas-and-return-dataframe-instead-of-num? It discusses converting the dataframe to a numpy array using as_matrix(), and then scaling. – rob0tst0p Mar 14 '22 at 18:26

0 Answers0