title: Retain pandas row numbers after applying a scipy filter function (with NANs)
body: <p>Given pandas dataframe:</p>
  
  <pre><code>   PT011
  0 -0.160
  1 -0.162
  2    NaN
  3 -0.164
  4    NaN
  5    NaN
  6 -0.166
  7 -0.167
  </code></pre>
  
  <p>after dropping NaNs...:</p>
  
  <pre><code>signal_PT011:
   0   -0.160
  1   -0.162
  3   -0.164
  6   -0.166
  7   -0.167
  </code></pre>
  
  <p>I apply scipy.butter function. I would like to retain pandas row numbers, because the filtered data should go back to original pandas array in new column, aligned with "old" row numbers. When I apply scipy.butter function I get the list without numbers of rows:</p>
  
  <pre><code>Filtered signal PT011:
   [-3.86174478e-05 -1.91854502e-04 -4.94647878e-04 -9.42136953e-04
   -1.52929127e-03]
  </code></pre>
  
  <p>As the effect I expect following output pandas dataframe:</p>
  
  <pre><code>Expected output:
      PT011  signal_PT011_filtered
  0 -0.160  -3.86174478e-05
  1 -0.162  -1.91854502e-04
  2    NaN              NaN
  3 -0.164  -4.94647878e-04
  4    NaN              NaN
  5    NaN              NaN
  6 -0.166  -9.42136953e-04
  7 -0.167  -1.52929127e-03
  </code></pre>
  
  <p>Here is my full code:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  from scipy import signal
  from scipy.signal import butter, lfilter
  
  probes = {'PT011': [-0.16,-0.162,np.NaN,-0.164,np.NaN,np.NaN,-0.166,-0.167]}
  df = pd.DataFrame(probes,columns= ['PT011'])
  print(df) # Pandas dataframe
  
  df=df.dropna() #Drop NaNs
  signal_PT011=df.loc[:,'PT011']
  
  print("Type of signal is:\n",type(signal_PT011)) # Pandas series
  print("signal_PT011:\n",signal_PT011)
  
  def butter_lowpass(cutoff, fs, order=2):
      nyq = 0.5 * fs
      normal_cutoff = cutoff / nyq
      b, a = butter(order, normal_cutoff, btype='low', analog=False)
      return b, a
  
  def butter_lowpass_filter(data, cutoff, fs, order=2):
      b, a = butter_lowpass(cutoff, fs, order=order)
      y = lfilter(b, a, data)
      return y
  
  order = 2
  fs = 100.0       # sample rate, Hz 
  cutoff = 0.5  # desired cutoff frequency of the filter, Hz
  
  signal_PT011_filtered = butter_lowpass_filter(signal_PT011, cutoff, fs, order) # Execute function to filter data:
  print("Filtered signal PT011:\n",signal_PT011_filtered)
  </code></pre>
  
  <p>What should I do?</p>