title: Python Pandas: Simple example of calculating RMSE from data frame
body: <p>Need a simple example of calculating RMSE with Pandas DataFrame. Providing there is function that returns in cycle true and predicted value:</p>
  
  <pre><code>def fun (data):
     ...
     return trueVal, predVal
  
  for data in set:
     fun(data)
  </code></pre>
  
  <p>And then some code puts these results in the following data frame where <code>x</code> is a real value and <code>p</code> is a predicted value: </p>
  
  <pre><code>In [20]: d
  Out[20]: {'p': [1, 10, 4, 5, 5], 'x': [1, 2, 3, 4, 5]}
  
  In [21]: df = pd.DataFrame(d)
  
  In [22]: df
  Out[22]: 
      p  x
  0   1  1
  1  10  2
  2   4  3
  3   5  4
  4   5  5
  </code></pre>
  
  <p>Questions:</p>
  
  <p>1) How to put results from <code>fun</code> function in <code>df</code> data frame?</p>
  
  <p>2) How to calculate RMSE using <code>df</code> data frame? </p>