title: Savgol filter over dataframe columns
body: <p>I'm trying to apply a savgol filter from SciPy to smooth my data. I've successfully applied the filter by selecting each column separately, defining a new y value and plotting it. However I wanted to apply the function in a more efficient way across a dataframe.</p>
  
  <pre><code>y0 = alldata_raw.iloc[:,0]
  w0 = savgol_filter(y0, 41, 1)
  </code></pre>
  
  <p>My first thought was to create an empty array, write a for loop apply the function to each column, append it to the array and finally concatenate the array. However I got an error 'TypeError: cannot concatenate object of type ""; only pd.Series, pd.DataFrame, and pd.Panel (deprecated) objs are valid'</p>
  
  <pre><code>smoothed_array = []
  for key,values in alldata_raw.iteritems():
      y = savgol_filter(values, 41, 1)
      smoothed_array.append(y)
  
  alldata_smoothed = pd.concat(smoothed_array, axis=1)
  </code></pre>
  
  <p>Instead I tried using the pd.apply() function however I'm having issues with that. I have an error message: 'TypeError: expected x and y to have same length'</p>
  
  <pre><code>alldata_smoothed = alldata_raw.apply(savgol_filter(alldata_raw, 41, 1), axis=1)
  print(alldata_smoothed)
  </code></pre>
  
  <p>I'm quite new to python so any advice on how to make each method work and which is preferable would be appreciated!</p>