title: I am trying to add in data to an existing PPT template using the python-pptx package
body: <pre class="lang-py prettyprint-override"><code>for x in range(row_count):
          for y in range(5):
              i = x // lines_per_slide
              z = [prs.slides[i].shapes[z].name for z in range(len(prs.slides[i].shapes))].index(&quot;name_of_table_in_ppt&quot;)
              line_num = x % lines_per_slide
              if y == 4:
                  try:
                      formatted_value = '{:.2f}'.format(data.iloc[x, y])
                  except:
                      formatted_value = &quot;&quot;
              else:
                  formatted_value = str(data.iloc[x, y])
  </code></pre>
  <p>However, I seem to get the following error message on the last line:</p>
  <blockquote>
  <p>IndexError: single positional indexer is out-of-bounds</p>
  </blockquote>
  <p>Any help would be greatly appreciated</p>