title: Python - y should be a 1d array, got an array of shape instead
body: <p>Let's consider data :</p>
  <pre><code>import numpy as np
  from sklearn.linear_model import LogisticRegression
  
  x=np.linspace(0,2*np.pi,80)
  x = x.reshape(-1,1)
  y = np.sin(x)+np.random.normal(0,0.4,80)  
  y[y&lt;1/2] = 0  
  y[y&gt;1/2] = 1
  clf=LogisticRegression(solver=&quot;saga&quot;, max_iter = 1000)
  </code></pre>
  <p>I want to fit logistic regression where y is dependent variable, and x is independent variable. But while I'm using :</p>
  <pre><code>clf.fit(x,y) 
  </code></pre>
  <p>I see error</p>
  <pre><code>'y  should be a 1d array, got an array of shape (80, 80) instead'. 
  </code></pre>
  <p>I tried to reshape data by using</p>
  <pre><code>y=y.reshape(-1,1) 
  </code></pre>
  <p>But I end up with array of length 6400! (How come?)</p>
  <p>Could you please give me a hand with performing this regression ?</p>