title: Add rows to pandas dataframe based on cyclic column condition
body: <p>I have a pandas dataframe that has some missing rows, which I can tell by evaluating the <code>cycle</code> column. This column cycles through 0-127 and repeats, till the end of the dataframe. I can tell that a row is missing if, for example, the values on this column jump from 36 to 38, meaning that the row corresponding to <code>cycle = 37</code> is missing.</p>
  <p>Here's an example of that:</p>
  <pre><code>df = pd.read_csv('Acc12019-08-08T21_52_46.3175552+01_00.csv')
  
        Command  RegisterAddress  Timestamp  accx  ...  magx  magy  magz  cycle
  27          3               34   115.0948   -83  ...  79.0  80.0 -78.0   35.0
  28          3               34   115.1004   -34  ...  79.0  80.0 -78.0   36.0
  29          3               34   115.1048    36  ...  79.0  80.0 -80.0   38.0
        ...              ...        ...   ...  ...   ...   ...   ...    ...
  3731        3               34   140.0191  1238  ...  44.0 -90.0 -39.0   30.0
  3732        3               34   140.0235  1243  ...  44.0 -90.0 -38.0   31.0
  3733        3               34   140.0293  1368  ...  43.0 -90.0 -35.0   33.0
  </code></pre>
  <p>What I want to do is add rows of <code>NaN</code>s where this condition is not met. Below is the expected outcome:</p>
  <pre><code>27          3               34   115.0948   -83  ...  79.0  80.0 -78.0   35.0
  28          3               34   115.1004   -34  ...  79.0  80.0 -78.0   36.0
            NaN              NaN        NaN   NaN        NaN   NaN   NaN   37.0
  29          3               34   115.1048    36  ...  79.0  80.0 -80.0   38.0
  </code></pre>
  <p>The missing rows are random and can happen at any <code>cycle</code> position, so I believe that the first thing would be to check where the <code>cycle</code> missing rows are. Note that, in the example above, <code>cycle=32</code> is also missing in the subsequent cycle.</p>
  <p>I've tried to look for ways of finding missing numbers on a list <a href="https://www.geeksforgeeks.org/python-find-missing-numbers-in-a-sorted-list-range/" rel="nofollow noreferrer">like this</a>, but so far with no success implementing it on my dataframe.</p>