title: Length of Values doesn't match length of index
body: <p>Big hello to the Stackoverflow community,</p>
  
  <p>I am trying to read in a .csv file with 1370 rows and two columns: <code>Time</code> and <code>Speed</code>.</p>
  
  <pre><code>Time   Speed
  
  0       1
  
  1       4
  
  2       7
  
  3       8
  </code></pre>
  
  <p>I want to find the difference in <code>Speed</code> between two time steps (e.g. <code>Time</code> <code>2</code> and <code>1</code>, which is <code>3</code>) for the entire length of the data. I want to add a new column <code>dS</code> with the previously calculated difference. The data would now look like: </p>
  
  <pre><code>Time   Speed  dS
  
  0       1     NaN
  
  1       4     3
  
  2       7     3
  
  3       8     1
  </code></pre>
  
  <p>The code I am using is as follows:</p>
  
  <pre><code>import pandas as pd
  from pandas import read_csv
  
  df2 = pd.read_csv ('speed.csv')
  
  dVV = []
  
  
  for i, row in df2.iterrows():
      dVV.append(df2.iloc[i+1,1] -  df2.iloc[i,1])
      break
  
  df2['dVV']=dVV
  </code></pre>
  
  <p>The error I am getting is:</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-29-4ed9fde37ff9&gt; in &lt;module&gt;()
       14     break
       15 
  ---&gt; 16 df2['dVV']=dVV
       17 
       18 #df2.to_csv('udds_test.csv', index=False, header=True)
  
  ~\Anaconda3\lib\site-packages\pandas\core\frame.py in __setitem__(self, key, 
  value)
     2517         else:
     2518             # set column
  -&gt; 2519             self._set_item(key, value)
     2520 
     2521     def _setitem_slice(self, key, value):
  
  ~\Anaconda3\lib\site-packages\pandas\core\frame.py in _set_item(self, key, 
  value)
     2583 
     2584         self._ensure_valid_index(value)
  -&gt; 2585         value = self._sanitize_column(key, value)
     2586         NDFrame._set_item(self, key, value)
     2587 
  
  ~\Anaconda3\lib\site-packages\pandas\core\frame.py in _sanitize_column(self, key, value, broadcast)
     2758 
     2759             # turn me into an ndarray
  -&gt; 2760             value = _sanitize_index(value, self.index, copy=False)
     2761             if not isinstance(value, (np.ndarray, Index)):
     2762                 if isinstance(value, list) and len(value) &gt; 0:
  
  ~\Anaconda3\lib\site-packages\pandas\core\series.py in _sanitize_index(data, 
  index, copy)
     3119 
     3120     if len(data) != len(index):
  -&gt; 3121         raise ValueError('Length of values does not match length of ' 
  'index')
     3122 
     3123     if isinstance(data, PeriodIndex):
  
  ValueError: Length of values does not match length of index
  </code></pre>
  
  <p>I am guessing that the code is breaking after the last 1370th row. How can I tackle this?</p>