title: Python sklearn library error "Invalid Type Promotion" while using logmodel.fit(X,y)
body: <p>I am trying to build a logistic regression model using the sklearn library. Things work fine till I create a training and test data sets (following this <a href="https://www.youtube.com/watch?v=VCJdg7YBbAQ" rel="nofollow noreferrer">tutorial</a>) but when I reach the stage where I execute the line "logmodel.fit(X=InDep_Train,y=Dep_Train)". I receive the following error. </p>
  
  <p>I keep receiving this "invalid type promotion" error at logmodel.fit step. Not sure if anybody else is receiving it. Trying to find out the solution on the internet but nothing related to the situation I am finding this error in. </p>
  
  <pre><code>    File "&lt;Folder Path&gt;/PythonFile.py", line 120, in &lt;module&gt;
  
      logmodel.fit(X=InDep_Train,y=Dep_Train)
    File "&lt;Folder Path&gt;\venv\lib\site-packages\sklearn\linear_model\_logistic.py", line 1525, in fit
      accept_large_sparse=solver != 'liblinear')
    File "&lt;Folder Path&gt;\venv\lib\site-packages\sklearn\utils\validation.py", line 739, in check_X_y
      estimator=estimator)
    File "&lt;Folder Path&gt;\venv\lib\site-packages\sklearn\utils\validation.py", line 459, in check_array
      dtype_orig = np.result_type(*array.dtypes)
    File "&lt;_array_function_ internals&gt;", line 6, in result_type
  TypeError: invalid type promotion
  </code></pre>
  
  <p>The InDep_Train is class 'pandas.core.frame.DataFrame'. </p>
  
  <p>The Dep_Train is class 'pandas.core.series.Series'</p>
  
  <p>I tried to fix the issue by using </p>
  
  <pre><code>from pandas.plotting import register_matplotlib_converters
  </code></pre>
  
  <p>but it didn't change anything. </p>