title: Time weighted moving average in pandas
body: <p>I would like to perform a time-weighted moving average in pandas that weights proportionately to how recent the observations were.</p>
  <p>Here is some sample data that I have.</p>
  <pre><code>dates = ['01/01/2021','02/01/2021','03/01/2021','04/01/2021','05/01/2021','06/01/2021']
  swimmer1_place = ['1','1','4','3',np.nan,np.nan,]
  swimmer2_place = [np.nan,'3','1',np.nan,'4','2']
  swimmer3_place = ['2','2','3',np.nan,'3','1']
  
  df = pd.DataFrame({'date':dates,'swimmer_1_place':swimmer1_place,'swimmer_2_place':swimmer2_place,'swimmer_3_place':swimmer3_place})
  df['date'] = pd.to_datetime(df['date'])
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SSdmT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SSdmT.png" alt="enter image description here" /></a></p>
  <p>What would be the best way to go about this? I have tried using the built-in Pandas EWM method with limited success because that doesn't consider the varying time intervals between the different swimmers.</p>