title: merge two pandas dataFrame based on the order of the first Dataframe
body: <p>I have two data Frame that I would like to merge, but I would like the first Dataframe to keep its order since it is based for a report and need to be ordered to analyze the data</p>
  <p>I could not find to do it; I tried merged_ordered but it did not work.</p>
  <p>here is my code :</p>
  <pre><code>ttm_data = {}
  for i,j in data['Financials']['Income_Statement']['quarterly'].items():
      ttm_data[i] = j
  df = pd.DataFrame(ttm_data).T
  df['formatted_date'] =  pd.to_datetime(df['date'])
  df.sort_values(by='formatted_date', ascending=True, inplace=True)
  not_wanted = [&quot;date&quot;, &quot;filing_date&quot;, &quot;currency_symbol&quot;, &quot;formatted_date&quot;]
  for i in list(df.columns):
      if i not in not_wanted:
           df[i] = df[i].astype(float)
  df = pd.DataFrame(df).T
  df1 = df.iloc[:,-4:].fillna(0)
  df1['sum']= df1.sum(axis=1, skipna=True, numeric_only=True)
  
  df1['TTM'] = df1.T.apply(pd.to_numeric, errors='coerce').dropna(how='all', axis=1).sum().reindex(df1.index, fill_value='-')
  df1[&quot;index_2&quot;]=df1.index
  #DataFrame.sum(axis=None, skipna=None, level=None, numeric_only=None, **kwargs)
  df3 = pd.merge_ordered(is_data, df1['TTM'], right_on= &quot;index_2&quot;, left_index= True)
  #df['Sum_Result'] = df.loc[0 : 1,[&quot;totalRevenue&quot; , &quot;costOfRevenue&quot;]].sum(axis = 1)
  </code></pre>
  <p>so in this example I would like to keep the order of is_data. df1 has the same rows but not in the same order ;(</p>
  <p>Thx you</p>