Cheat Sheet of Python for Finance and FP&A: 5 Easy Ways to use Python
4 min readMay 2, 2023
Python is a powerful programming language that can be used in Financial Planning and Analysis (FP&A) to automate various tasks and streamline workflows.
Here is a cheat sheet of Python for FP&A with the code.
And remember, you DO NOT need to install Python on your computer. You can just use Google Colab (think Google Docs but for Programming) and run Python on your favorite browser!
1. Creation of PowerPoint Slides from Excel
Python provides several libraries such as pywin32
, python-pptx
, and pptx2pdf
to create PowerPoint presentations from Excel data. Here are the basic steps:
- Import the necessary libraries.
- Read the Excel data using the
pandas
library. - Create a PowerPoint presentation using the
python-pptx
library. - Add slides and charts to the presentation.
- Save the presentation using the
pptx
library.
import pandas as pd
from pptx import Presentation
from pptx.util import Inches
# read Excel data
df =…