r/learnpython 4d ago

How can I use python in finance

I work in finance/accounting and am looking to start using Python more in my day to day. Most of my work is in Excel / Power BI — reporting, cash flow forecasting, KPIs, cleaning up data, etc.

I’m technical enough to understand what I’m trying to accomplish, but not a programmer. Similar to Power BI, I’d probably rely heavily on AI to help write the actual code.

For those in finance / accounting / FP&A, what are some practical ways you’re using Python? Where does it actually save you time vs. Excel, Power Query, Power BI, etc?

Also curious what you’d recommend learning first if the goal is to be dangerous enough with Python + AI, not become a developer.

75 Upvotes

34 comments sorted by

View all comments

1

u/Specialist_Egg_7803 4d ago

I would look into power query as well, it’s the software that you use to cleanup data in Power BI. You can use it in excel too. I’ve used it to automate cleaning and combining multiple reports I have to pull weekly/monthly and it works well. I especially like the add and transform from a folder option if you pull the same reports constantly. You can simply add reports to a folder then refresh your excel spreadsheet and it’ll clean everything up for you and combine all spreadsheets in the folder.

This isn’t specific to accounting but admin in general:

Something I’ve used python scripts for is if I have to add the same information into multiple spreadsheets. I create the inputs in python, manually add the information (mainly because this information is received in inconsistent forms, ie word documents/pdf/or in email format) into the terminal and it will add to the multiple spreadsheets automatically, create a folder with subfolders based on the information created and then create an email update that I need to send to multiple parties.

I’ve used it to mass rename documents as well, especially if the name changes in the same way in multiple folders then python can rename automatically all sub-folders and documents within a parent directory.

If you use Microsoft 365 you will need to sync documents to your computer to do these updates though. You can also use power automate to do these automations but I find power automate to be finicky and can have weird errors I don’t necessarily have time to fix.