Does anybody know how can i solve this warning in the code below?
Here is the warning: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample. warnings.warn(DEPRECATION_MSG_1D, DeprecationWarning)
Here is the code:
%matplotlib inline
import numpy as np
import pandas as pd
from scipy import stats, integrate
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
import seaborn as sns
data = np.genfromtxt('name.csv', delimiter=",")
X = data[:,1]
mms = MinMaxScaler()
a=X.reshape(-1, 1)
a_norm = mms.fit_transform(X)
sns.set(color_codes=True)
np.random.seed(sum(map(ord, "distributions")))
sns.distplot(a_norm);
Even though, I am making changes according to the warning, I am getting the error which is mentioned above from this line "a_norm = mms.fit_transform(X)".
I really need help for this warning
X.reshape, save the result into a variable calledawhich you then never reference for the rest of the script. I suspect you mean to passainstead ofXto which function is throwing that deprecation warning? - Shadowa_norm = mms.fit_transform(X)? Shouldn't that bea_norm = mms.fit_transform(a)? - Shadow