Part 7: Code Quality & Collaboration in Python

Code Quality & Collaboration: Building Finance Tools That Last As a finance professional learning Python, you’ll soon want to move beyond writing scripts just for yourself. Whether you’re building financial models, automating reporting, or creating data analysis tools, there comes a point when your code needs to be shared with colleagues or even the wider finance community. This post will guide you through best practices for creating high-quality, shareable code. ...

Part 6: Virtual Environments & Packaging in Python

Virtual Environments & Packaging in Python As your Python journey progresses and you start building more sophisticated financial tools, you’ll inevitably need to use external libraries. This is where virtual environments and package management become crucial skills. In this post, I’ll cover how to create isolated environments for your projects and manage dependencies effectively. Why Virtual Environments Matter Imagine this scenario: You’re working on two different financial applications. One requires pandas version 1.3 for compatibility with other tools, while the other needs the latest pandas 2.0 for new features. Without virtual environments, you’d be forced to choose one version for your entire system, potentially breaking one of your applications. ...

Part 5: Functions, Modules & File I/O in Python

Functions, Modules & File I/O in Python These next concepts incredibly useful for organising code and working with external data. Let’s explore how Python handles functions, modules, and file operations - all essential skills for financial analysis and reporting. Defining and Calling Functions Functions are reusable blocks of code that perform specific tasks. They help keep your code DRY (Don’t Repeat Yourself) and make it more maintainable. Basic Function Syntax def function_name(parameters): """Docstring explaining what the function does.""" # Function body return result # Optional Here’s a simple function that calculates compound interest: ...

Part 4: Core Data Structures in Python

Post 4: Core Data Structures Welcome to the fourth post in my Python learning journey. So far, we’ve installed Python, set up a development environment, and explored the basic syntax. Now it’s time to dive deeper into Python’s core data structures; the building blocks you’ll use to organise and manipulate data in your programs. In this post, we’ll cover: Lists: Python’s versatile sequence type Tuples: Immutable collections Dictionaries: Key-value mapping Sets: Unique value collections Choosing the right data structure I’ve found these data structures similar to concepts we use every day; lists are like columns in spreadsheets, dictionaries resemble lookup tables, and sets are perfect for tracking unique items like account codes. ...

Part 3: Python Syntax Fundamentals & Language Features

Post 3: Python Syntax Fundamentals & Language Features Welcome to the third post in my Python learning journey. In the first two posts, we installed Python and set up a proper development environment. Now it’s time to dive into the language itself. This post covers the fundamental building blocks of Python code that I’ve been learning. We’ll explore: Variables and basic data types Operators and expressions Control flow with conditionals and loops List comprehensions and lambdas Iterators and generators Error handling with try/except This post is a bit longer than the previous ones, but these fundamentals form the foundation of everything else in Python, so it’s worth taking the time to understand them. ...