视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
skill-014【文档与办公】Extract and manage data embedded in PowerPoint presentations. This skill facilitates the retrieval of charts, tables, and other data elements from .pptx files.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Data embedded in PowerPoint presentations can provide valuable insights and facilitate analysis. This skill covers methods for extracting tables, charts, and other data elements from .pptx files.
To extract tables from a PowerPoint slide, use the following method:
from pptx import Presentation
# Load the presentation
prs = Presentation('path-to-file.pptx')
# Extract data from tables
for slide in prs.slides:
for shape in slide.shapes:
if shape.has_table:
table = shape.table
for row in range(len(table.rows)):
for col in range(len(table.columns)):
cell = table.cell(row, col)
print(cell.text)
Charts can also be extracted for further data analysis. The following example demonstrates how to get chart data:
for slide in prs.slides:
for shape in slide.shapes:
if shape.has_chart:
chart = shape.chart
data = chart.plots[0].chart_data
print(data)
The ability to extract data from PowerPoint presentations can enhance your analytical capabilities and enable better decision-making based on visual data representations.