title: Copying a column from one DataFrame to another gives NaN values?
body: <p>This <a href="https://stackoverflow.com/questions/38961170/pandas-add-values-of-column-to-different-dataframe">question</a> has been asked so many times, and it seemed to work for others, however, I am getting <code>NaN</code> values when I copy a column from a different DataFrame(<code>df1</code> and <code>df2</code> are same length). </p>
  
  <p><code>df1</code></p>
  
  <pre><code>        date     hour      var1
  a   2017-05-01  00:00:00   456585
  b   2017-05-01  01:00:00   899875
  c   2017-05-01  02:00:00   569566
  d   2017-05-01  03:00:00   458756
  e   2017-05-01  04:00:00   231458
  f   2017-05-01  05:00:00   986545
  </code></pre>
  
  <p><code>df2</code></p>
  
  <pre><code>      MyVar1     MyVar2 
   0  6169.719338 3688.045368
   1  5861.148007 3152.238704
   2  5797.053347 2700.469871
   3  5779.102340 2730.471948
   4  6708.219647 3181.298291
   5  8550.380343 3793.580394
  </code></pre>
  
  <p>I need like this in my <code>df2</code></p>
  
  <pre><code>       MyVar1    MyVar2        date        hour
   0  6169.719338 3688.045368  2017-05-01  00:00:00
   1  5861.148007 3152.238704  2017-05-01  01:00:00
   2  5797.053347 2700.469871  2017-05-01  02:00:00
   3  5779.102340 2730.471948  2017-05-01  03:00:00
   4  6708.219647 3181.298291  2017-05-01  04:00:00
   5  8550.380343 3793.580394  2017-05-01  05:00:00
  </code></pre>
  
  <p>I tried the following,</p>
  
  <pre><code>df2['date'] = df1['date']
  df2['hour'] = df1['hour']
  
  type(df1)
  &gt;&gt; pandas.core.frame.DataFrame
  
  type(df2)
  &gt;&gt; pandas.core.frame.DataFrame
  </code></pre>
  
  <p>I am getting the following,</p>
  
  <pre><code>       MyVar1    MyVar2      date       hour
   0  6169.719338 3688.045368  NaN        NaN
   1  5861.148007 3152.238704  NaN        NaN
   2  5797.053347 2700.469871  NaN        NaN
  </code></pre>
  
  <p>Why is this happening? There is another <a href="https://stackoverflow.com/questions/38572583/copy-values-from-one-dataframe-to-another-dataframedifferent-length-by-compari">post</a> that discusses <code>merge</code>, but I just need to copy it. Any help would be appreciated.  </p>