title: Applying RMS formula over three columns pandas
body: <p>I am trying to apply a RMS function for Accelero-meter data which is in 3 dimension. Also, I have a time stamp column at the beginning which I have kept in days count. So the dataframe is as follows:</p>
  
  <pre><code>       0        1       2      3
  0   1.963   -12.0   -71.0   -2.0
  1   1.963   -11.0   -71.0   -3.0
  2   1.963   -14.0   -67.0   -6.0
  3   1.963   -16.0   -63.0   -7.0
  4   1.963   -18.0   -60.0   -8.0
  </code></pre>
  
  <p>column '0' is Days, and all the other columns are the 3-axis data of accelero-meter. Right now I am using this approach to compute the RMS value to a new column and drop the existing 3-axis data : </p>
  
  <pre><code>def rms_detrend(x):
      return np.sqrt(np.mean(x[1]**2 + x[2]**2 + x[3]**2))
  
  accdf =pd.read_csv(ACC_files[1],header=None)
  accdf['ACC_RMS'] = accdf.apply(rms_detrend,axis=1)
  accdf = accdf.drop([1,2,3],axis=1)
  accdf.columns = accdf['Days','ACC_RMS']
  </code></pre>
  
  <p>However, I have 70 such files of Accelerometer data each with about 4000+ rows. So is there a better and quicker(pythonic) way to do this ? Thanks. 
  The code above I have done for just one file and its very slow.</p>