title: How to update rows in an "Excel-file Column" with the contents of a pandas data frame col
body: <p>EDIT_01: I just noticed my way does not work properly as it removes the &quot;Horse&quot; field from the saved excel file.
  EDIT_02: I have a work-round but I'm sure there must be a better way.  Work-round by deleting the &quot;Odds&quot; column in df1 then merge df1 with  df_odd then save df1.  This still moves the &quot;Horse&quot; column to the first column (owing to the index declaration, I suppose) but I can live with that.</p>
  <p>Thanks in advance for any suggestions.
  I have an Excel file with Horse (Odds) details that I want to update.  e.g.</p>
  <pre><code>Draw    Form    Horse       Age Weight  OR  Jockey          Trainer Allow   RTF TS  RPR Days    Aid WtLbs   CDB Odds
  6       05035-  Buy Me Back 5   9-7     74  Luke Morris     Mark Loughnane  52  74  85  37      133 C       D   SP
  2       /2473-  Alablaq     4   9-6     73  George Downing  David Evans     41  72  84  17      132             SP
  4       1018-3  Helvetian   7   9-5     72  Sean Levey      Kevin Frost     29  78  85  4   t   131         D   
  5       32676-  Vape        5   9-1     68  Hollie Doyle    Tony Carroll    26  71  87  28      127         D   SP
  </code></pre>
  <p>I want to update the Odds column with the &quot;Odds&quot; data from df_odd for corresponding Horses.
  df_odd example:</p>
  <pre><code>    Horse       Course      Time    Date        Odds
  0   Abnaa       Newcastle   15:10   2022-01-06  
  1   Affoburg    Chepstow    15:20   2022-01-06  66/1
  </code></pre>
  <p>At the moment I can do it by making an &quot;RC_Odds.xlsx&quot; file and reading it back into python and then use df1[&quot;Odds&quot;] = df1[&quot;Odds&quot;].</p>
  <p>I assume there is a neater way to do the same without the need to make an &quot;RC_Odds.xlsx&quot; file but I can't work out the syntax.
  Any help would be welcome.
  Thanks.</p>
  <p>my work-round code is:</p>
  <pre><code>df_odd = pd.DataFrame(get_odds(date_ext))
              df_odd.to_excel('Racecards\RC_Odds.xlsx', index = False)
  
              # reading two csv files
              df1 = pd.read_excel('Racecards/Racecards.xlsx', index_col=&quot;Horse&quot;)
              df2 = pd.read_excel('Racecards/RC_Odds.xlsx', index_col=&quot;Horse&quot;)
              del df1[&quot;Odds&quot;]
  
              df1 = pd.merge(df1, df2, on ='Horse', how =&quot;left&quot;)
              df1 = df1.reset_index()
  
              df1.to_excel(f'{&quot;Racecards/Racecards&quot;}.xlsx', index = False)
              print(&quot;Odds Updated&quot;)
  </code></pre>