title: Got error in my python code "ValueError: Found input variables with inconsistent numbers of samples: [16, 8760]"
body: <p>I used python 2.7 and sklearn 1.8.</p>
  
  <pre><code>import numpy as np
  from sklearn.naive_bayes import GaussianNB
  </code></pre>
  
  <p>then I created 2d array using 1d arrays.</p>
  
  <pre><code>x=np.array([a,b,c,d...])
  </code></pre>
  
  <p>like that (a,b,c,d.. are 1d arrays)</p>
  
  <pre><code>y=np.array(arr)
  </code></pre>
  
  <p>arr also 1d array</p>
  
  <pre><code>model = GaussianNB()
  model.fit(x,y)
  </code></pre>
  
  <p>its give me a this error</p>
  
  <pre><code>    File "E:/python/read2.py", line 73, in &lt;module&gt;
      model.fit(x,y)
    File "C:\Python27\lib\site-packages\sklearn\naive_bayes.py", line 182, in fit
      X, y = check_X_y(X, y)
    File "C:\Python27\lib\site-packages\sklearn\utils\validation.py", line 531, in check_X_y
      check_consistent_length(X, y)
    File "C:\Python27\lib\site-packages\sklearn\utils\validation.py", line 181, in check_consistent_length
      " samples: %r" % [int(l) for l in lengths])
  ValueError: Found input variables with inconsistent numbers of samples: [16, 8760]
  </code></pre>
  
  <p>x.shape => (16, 8760)
  y.shape => (8760,)</p>
  
  <p>please need help..</p>