title: "Found input variables with inconsistent numbers of samples" error cause by pandas dropna()
body: <p><a href="https://i.stack.imgur.com/LgsNp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LgsNp.png" alt="enter image description here" /></a></p>
  <p>I'm using the data like this. To utilize LightBGM, I used <code>X=X.dropna()</code>,to prevent later errors related to the &quot;Input contents NaN, Infinity or a value too large for dtype('float64').&quot;</p>
  <pre><code>X_train, X_test, y_train, y_test=train_test_split(X, y, test_size=0.2,
  random_state=333 )
  </code></pre>
  <p>After that, I used train_test_split function. However,</p>
  <pre><code>ValueError: Found input variables with inconsistent numbers of samples: [2348, 2356]&quot; 
  </code></pre>
  <p>error caused. I think the <code>X=X.dropna()</code> made the error because it elimated Unnecessary NaN values.</p>
  <pre><code> X.shape
  (2348, 15)
  y.shape
  (2356,)
  </code></pre>
  <p>So to solve the problem, the above result was printed when I printed out each &quot;shape&quot;. But I don't know what action to take on my data.I think this is because there is a difference of about 8 in the shape values of X and y. Is there a good way to solve this problem?</p>