title: How to remove data from QTableWidget in pyqt5 in Python
body: <p>I have a table which has below data:</p>
  <p><a href="https://i.stack.imgur.com/yjB5c.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yjB5c.jpg" alt="enter image description here" /></a></p>
  <p>I want to remove all the data from the rows and just want to keep the headers i.e. Person Name, Number of Photos Enrolled and Gallery. How can I do this in pyqt5 python. Below is the code I tried but seems not to working:</p>
  <pre><code> for item in self.home_ui.show_person_gallery_table.selectedItems():
       new_item = self.home_ui.show_person_gallery_table.item()
       self.home_ui.show_person_gallery_table.setItem(item.row(), item.column(), new_item)
  </code></pre>