Part 11: NumPy Fundamentals for Numerical Data

NumPy Fundamentals for Numerical Data (with Finance Applications) Welcome to post #11 in our Python learning journey! If you’ve been following along, you’re starting to build a solid foundation in Python. Now it’s time to explore NumPy, the powerhouse library that makes Python a serious contender for numerical computing and data analysis. As a finance professional myself, I’ve found NumPy particularly useful for financial calculations, portfolio analysis, and working with large datasets. Let’s dive in and see how this library can level up your Python skills. ...

Part 10: The Python Ecosystem & Interactive Data Workflows

The Python Ecosystem & Interactive Data Workflows As a finance professional diving deeper into Python, I’ve found that understanding the broader ecosystem of tools is just as important as learning the language itself. In this post, we’ll explore the different ways to manage Python packages and environments, and dive into interactive data workflows that can transform how you work with financial data. Package vs. Environment Managers: pip, conda, and Anaconda When I first started with Python, I was confused by the different tools available for installing packages and managing environments. Let’s clarify these concepts. ...

Part 9: Command-Line Tools & Automation with Python

Command-Line Tools & Automation in Python I’ve discovered that some of the most practical Python applications aren’t fancy data visualisations or machine learning models, but rather simple automation scripts that save time on repetitive tasks. In this post, I’ll walk through how to build command-line tools and automate everyday processes using Python. Building Command-Line Scripts with argparse When you’re working with financial data, you often need flexible tools that can handle different inputs. The argparse module lets you build command-line scripts that accept various arguments and options. ...

Part 8: Testing & Debugging Python Code

Testing & Debugging: Building Reliable Financial Tools When working with financial data and calculations, accuracy is essential. A small bug in your code could mean reporting incorrect figures, making flawed investment decisions, or even compliance issues. This post will guide you through testing and debugging techniques that ensure your financial Python code works correctly and reliably. Why Testing Matters in Finance Imagine you’ve created a Python script that calculates loan amortisation schedules. Your company uses this tool to price thousands of loans. If there’s an error in your interest calculation logic, even a small one, the financial impact could be enormous. ...

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. ...

Part 2: Text Editors vs. IDEs for Python Development

Post 2: Text Editors vs. IDEs for Python Development Welcome to the second post in my Python learning series. Last time, we got Python installed and ran our first code. Now it’s time to set up a proper coding environment. Working directly with .py files in Notepad gets tedious quickly, so let’s explore better options for writing Python code. In this post, we’ll cover: The difference between text editors and IDEs Popular options for Python development Setting up VS Code for Python (my personal choice) Key productivity features that will save you time Running and debugging Python code from your editor 1. Text Editors vs. IDEs: What’s the Difference? When I started learning Python, I was confused about whether to use a “text editor” or an “IDE”. Here’s the simple breakdown: ...