title: How to add values from dataframes to another dataframe for right index?
body: <p>I want to add a column 'direction' to df_trials with value 7 for x>0, y=0 and 8 for x=0,y>0.
  I have dataframes for every direction seperatly.</p>
  
  <pre class="lang-py prettyprint-override"><code>df_trials_direction_7 = df_trials_clean[df_trials_clean["target_x"] &gt; 0]
  df_trials_direction_7 = df_trials_direction_7[df_trials_direction_7["target_y"] == 0]
  df_trials_direction_7['direction']=7
  
  df_trials_direction_8 = df_trials_clean[df_trials_clean["target_x"] == 0]
  df_trials_direction_8 = df_trials_direction_8[df_trials_direction_8["target_y"] &gt; 0]
  df_trials_direction_8['direction']=8
  </code></pre>
  
  <p>df_trials_clean looks like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>user trial target_x target_y
  1    2     10       0
       3     0        5
  2    1     4        0
       4     0        6
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre class="lang-py prettyprint-override"><code>df_trials_clean['direction']=df_trials_direction_8['direction']
  df_trials_clean['direction']=df_trials_direction_7['direction']
  </code></pre>
  
  <p>but this only adds 7 to the column and puts NaN at the places where 8 should be.
  I've simplified it a bit, there are 8 directions in total so simply replacing NaN by 8 won't work.</p>
  
  <p>The desired output is:</p>
  
  <pre class="lang-py prettyprint-override"><code>user trial target_x target_y direction
  1    2     10       0        7
       3     0        5        8
  2    1     4        0        7
       4     0        6        8
  </code></pre>