I'm trying to use OneHot encoder in the following series:
1 redução
2 redução
3 redução
4 redução
...
1969 normal
1970 normal
1971 normal
1972 normal
1973 normal
Length: 1974, dtype: object
But it's returning me the following error
ValueError: Expected 2D array, got 1D array instead:
array=['redução' 'redução' 'redução' ... 'normal' 'normal' 'normal'].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
I already tried the approach above and also tried np.array(s.values.tolist()) and it also didn't work, can anyone help me with this please?
This series has actually 3 unique values, that's why I'm trying to use OneHotEncoder