Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected 2D array, got 1D array instead #16

Open
guireif opened this issue Mar 26, 2019 · 1 comment
Open

Expected 2D array, got 1D array instead #16

guireif opened this issue Mar 26, 2019 · 1 comment

Comments

@guireif
Copy link

guireif commented Mar 26, 2019

Hi,

I'm getting the following error when I run the following cell
What should I do?

scaler = MinMaxScaler(feature_range=(-1, 1)) train_sc = scaler.fit_transform(train) test_sc = scaler.transform(test)

Expected 2D array, got 1D array instead: array=[17.24 18.190001 19.219999 ... 10.47 10.18 11.04 ]. Reshape your data either using array.reshape(-1, 1)

@taufique1929
Copy link

scaler = MinMaxScaler(feature_range=(-1,1))
train = np.asarray(train).reshape(-1,1)
test = np.asarray(test).reshape(-1,1)
train_sc = scaler.fit_transform(train)
test_sc = scaler.transform(test)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants