from pptx import Presentation
from pptx.util import Inches
import copy
ppt = Presentation('path_to_presentation.pptx')
for slide in ppt.slides:
for shape in slide.shapes:
if shape.has_table:
table = shape.table
new_table = copy.deepcopy(table)
left = Inches(1)
top = Inches(1)
width = Inches(5)
height = Inches(2)
new_shape = slide.shapes.add_table(
rows=len(new_table.rows), cols=len(new_table.columns), left=left, top=top, width=width, height=height
)
for r in range(len(new_table.rows)):
for c in range(len(new_table.columns)):
new_shape.table.cell(r, c).text = new_table.cell(r, c).text
ppt.save('path_to_new_presentation.pptx')