title: How to calculate Rolling Correlation with pandas?
body: <p>I understand how to calculate a rolling sum, std or average. Example:</p>
  
  <pre><code>df['MA10'] = df['Asset1'].rolling(10).mean()
  </code></pre>
  
  <p>But I don't understand the syntax to calculate the rolling correlation between two dataframes columns: <code>df['Asset1']</code> and <code>df['Asset2']</code></p>
  
  <p>The documentation doesn't provide any example regarding the correlation.</p>
  
  <p><a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rolling.html" rel="noreferrer">https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rolling.html</a></p>
  
  <p>Any insights?</p>
  
  <p>Thanks!</p>