title: How best to insert NaN values in a Python list by referring to an already sorted list
body: <p>I have a sorted list containing unique values which is obtained from a master 2d list of values :</p>
  
  <pre><code>Sorted_List = [1,2,3,4]
  
  Master_List =
  [[1],
  [1,2],
  [1,4],
  [3]]
  </code></pre>
  
  <p>I want to use the sorted list and convert the master list to:</p>
  
  <pre><code>Converted_Master_List :
  [[1,NaN,NaN,NaN],
  [1,2,NaN,NaN],
  [1,NaN,NaN,4],
  [NaN,NaN,3,NaN]]
  </code></pre>
  
  <p>How do I best do this.</p>
  
  <p>Ultimately I have to write this into an CSV/excel file.</p>
  
  <p>I already written code to do the sorting from master list and write the output into the CSV file, need to fill in the NaN values in between to better format the output. </p>