Python Project Ideas Finance & Quantitative Finance

Completing programming projects is an essential part of learning Python for Finance. Yet it is a complicated step to move from coding exercises to the creative process of developing a program on your own.

To help you out on your learning journey, I have compiled a selection of Python project ideas for beginners (topic: Finance & Quantitative Finance). You can also watch my YouTube video where I explain how to approach each idea in detail.

Idea 1: Excel to Python

This would be the most straightforward project to try if you have ever worked with data in Microsoft Excel. Just think of the most common commands you use and look up how to put them into Python.

The Python libraries that you would need are pandas and numpy.

Idea 2: Black & Scholes model calculator

Alright, I assume that you have already studied the BS model in your finance courses. If you did, then you must know that your formula looks like this:

Black Scholes model formula

When you need to plug it into your calculator, it can get overwhelming. Therefore, I would offer to code the formula in Python.

The libraries to be used here: numpy for calculations and scipy to get the normal distribution.

Then, what you would need to do is to define a function which takes the parameters that the BS formula takes and then enter the formula in the Python environment. To check the output, you can take some arbitrary numbers in your calculator and just see what’s going to happen.

To make this project complete, don’t forget to mention the assumptions of the Black-Scholes model and the meaning of the parameters. Also, to make it more interesting, I would mention the limitations that the model has and give a real-life example of when the model becomes impractical due to those limitations.

Idea 3: OLS Regression

Let’s talk about Econometrics, which I assume you studied as a part of your Finance curriculum. Very likely that you used Matlab, Stata or other statistical software to run the regressions, but what if I told you that Python also has those features?

In Python, there is a nice library which offers the features of statistical software including OLS regression and other regressions. I am talking about statsmodels library.

You can apply this logic to predict a relationship between X and Y variables.

To run the model, you call the ols method from statsmodels.formula.api, and you plug in the formula for your regression. After fitting the model, you would get the output table. In the output table, you would see the estimated coefficients, their significance levels in column t, the R-squared measure and other parameters.

As you can see, there is barely any coding to do, so the key idea of such a project would be to describe the model in your own words, and then discuss the data and the importance of your research question.

Idea 4: Data visualization

Another important skill in our profession is to be able to communicate what you are doing. Here, data visualization comes in very useful, and again, Python is offering a nice solution to cover it.

I am talking about the Seaborn library, where you can create fancy-looking graphs with one line of code. 

The libraries you need for a similar project: seaborn for plotting and pandas to store your data.

In one of my projects, I took a diverse dataset with many variables – both categorical and numeric, and I could therefore display four variables in one graph.

The approach is very straightforward: you load the data and assign each variable to a graph attribute. 

Be creative in the way you complete this project. Talk about where your data comes from, set the hypothesis on what you think is the relationship between the variables, discuss the importance of researching the topic, etc.

You can find a complete code in my article on data visualization.

Idea 5: Data preprocessing

Data preprocessing is an essential skill for any data-related job. You can read more about my approach to data preprocessing in the previous post. Especially, if you are working with financial data, most models, including the Black-Scholes model assume the log-normal distribution.

What does it mean exactly? Think of a stock price: it cannot be negative and also large outliers are unlikely. Because large outliers would happen in case of unexpected events: the drop in price happens during a crisis and the drastic price increase happens if a company made a huge breakthrough in their development. This is why it is important to be aware of your data before running your models and pulling conclusions. 

Normal and Log-normal data distribution

You can apply Python to (1) explore the data and (2) transform the data. Libraries that you will need: pandas and numpy. In case you want to have an arbitrary dataset, you can also make use of the yahoo finance library which allows for retrieving market data.

With Python, we can plot the histogram to see how the data is distributed. Most likely you would have to transform the data by taking the logarithm of each data point.

The idea is that you need to transform the data such that it fits the assumptions of the model that you use in your analysis.

I hope you found these ideas interesting and inspiring to try on your own! Please refer to my video on python project ideas for finance if you want to see a more detailed explanation.

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *