title: Python Error: Unable to coerce to Series, length must be 16: given 14
body: <p>I'm trying to combine the columns from 2 dataframes into one dataframe so I can build training and test samples. I'm using the walkthough at this link <a href="https://towardsdatascience.com/predicting-hospital-readmission-for-patients-with-diabetes-using-scikit-learn-a2e359b15f0" rel="nofollow noreferrer">Towards Data Science</a> but I'm using a different excel spreadsheet.</p>
  <p>So far all the code has worked until I try to combine the columns of the two data frames. The code is below is a trimmed down version of what I have so far, but I believe all the code that I left out was just exploring the data. All that said, I'm pretty new on my Python journey, so I'm not sure how much code would be beneficial, so I can post more if I need to.</p>
  <p>All the code works except for the last line, which gives me this error: Unable to coerce to Series, length must be 16: given 14</p>
  <p>Any ideas?</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  healthcare = pd.read_csv('/medical_clean.csv')
  
  cols_cat_num = ['ReAdmis', 'Initial_admin', 'HighBlood', 'Stroke', 'Complication_risk', 'Overweight', 'Arthritis', 'Diabetes', 'BackPain', 'Anxiety', 'Allergic_rhinitis', 'Reflux_esophagitis', 'Asthma']
  healthcare[cols_cat_num] = healthcare[cols_cat_num].astype('str')
  
  healthcare_cat=pd.get_dummies(healthcare[cols_cat_num + ['HighBlood']], drop_first = True)
  
  healthcare_num=['Population', 'VitD_levels', 'Income', 'Doc_visits', 'Full_meals_eaten', 'vitD_supp', 'Item1', 'Item2', 'Item3', 'Item4', 'Item5', 'Item6', 'Item7', 'Item8']
  
  healthcare[healthcare_num]= healthcare[healthcare_num].astype('str')
  
  finalhealth= healthcare_num + healthcare_cat
  </code></pre>