title: Remove outlier from time series data using pandas
body: <p>I have one-minute data:</p>
  <pre><code># Import data
  import yfinance as yf
  data = yf.download(tickers=&quot;MSFT&quot;, period=&quot;7d&quot;, interval=&quot;1m&quot;)
  print(data.tail())
  </code></pre>
  <p>I would like to remove observations where minute difference is grater than daily difference, where we refere to day of the minute bar. I would like to apply this rule on every column except volume. Begining of the code:</p>
  <pre><code>minute_diff = data.diff()
  dail_diff = data.resample('D').last().diff().median()
  
  # here remove rows from data were minute_diff is grater than daily diff
  </code></pre>