title: pandas dictionary formation exiting code before completion of iteration
body: <p>I am trying to create a dictionary of a data frame with 18330 rows.
  but the dictionary is stopping at 15275th row.
  I am not able to understand the root cause for the same.</p>
  
  <p>'''</p>
  
  <pre><code>final_dict = dict()
  item = df1['Item Code']
  id = df1['store ID']
  sp = df1['Selling Price']
  mrp = df1['MRP']
  
  for a in range(0, item.__len__()):
      key = str(item[a]) + "|" + str(id[a])
      value = str(sp[a]) + "|" + str(mrp[a])
      final_dict[key] = value
      key_list = final_dict.keys()
  
  
  print(item.__len__())
  print(len(final_dict))
  print(len(key_list))
  print(len(df1.index))
  df1['key'] = key_list
  print(df1)
  </code></pre>
  
  <p>'''</p>
  
  <pre><code>Output: 
  18330
  15275
  15275
  18330
  error : "ValueError: Length of values does not match length of index"
  </code></pre>
  
  <p>Dataframe Sample:</p>
  
  <p><a href="https://i.stack.imgur.com/ubI6S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ubI6S.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me understand my mistake here.</p>