This repository hosts the code of Value Investing in Python, a data science tutorial published in Medium. This tutorial covers fundamental analysis for US stocks.
The organization of this tutorial falls into the following parts:
1. Collecting financial data for fundamental analysis
Data is the foundation of this project, and all the subsequent analysis will use data collected in this section. In this section, we have 3 learning objectives:
- Understand the basic concept of value investing and intrinsic value
- Understand what data will be needed to calculate intrinsic value
- Learn to collect the financial data needed from future use
2. How to Generate these Popular Stock Terms using Python
This section covers the relative simple metrics which will be very useful in fundamental analysis. Here we have 4 learning objectives:
- What are some important metrics for value investing
- Learn to load financial data into Pandas
- Learn how to retrieve and calculate the metrics using Pandas
3. How to calculate the intrinsic value
This section unveils the definition of intrinsic value, and also provide a step-by-step calculation for intrinsic value. Here we have 2 learning objectives:
- Calculate intrinsic value in 2 ways
- Discuss the downside and remedy for these 2 methods
If you have been trading stocks for years but conducted your fundamental analysis manually, this is the starting point for you to automate your analysis. Thus, you could conduct a fundamental analysis on a large scale, save a lot of time and avoid human mistakes.
If you have just started to trade stocks, and have no idea about how to evaluate a stock. Then, this tutorial could help you establish a basic framework and hypothetically save you some money for avoiding some obvious mistakes.
If you are a data science newbie, wish to gain some hands-on experience. Then, the finance field can be an ideal starting point since it could offer you tons of organized and relatively clean data.
You do not need to know any finance to be able to study this tutorial, as we will introduce Preston Pysh’s videos, who did a great job in teaching financial concepts in an easy-to-understand way.
Python basics and Pandas would be required. If you are not familiar with them, here are some resources could be helpful:
- Python 3 Tutorial — Learn Python in 30 Minutes: What you need to know is the first 6 bullet points, from ‘Run Python on your computer’ to ‘Exceptions (Handling, User-defined Exception, …)’
- Get Started With Python Pandas In 5 minutes
You could also try to start without Python and Pandas basics since I am trying to make everything clear. But if you at some point feel hard to understand what the code does, please feel free to leave me a comment and come back to these tutorials.
I am working with teammates to build a website that hosts tutorials and also provide financial insights, stock recommendation based on the technologies that we learned and taught on the website.
I want to thank Preston Pysh, Investopedia, StatQuest and Towards Data Science.
Preston Pysh created a fantastic value investing course on YouTube. I would recommend this course to anyone with an interest in investing and finance.
Investopedia is my initial source of financial knowledge. It offers an easy-to-understand explanation for financial terms. StatQuest and Towards Data Science have great tutorials on Machine Learning and Stats.
I benefited a lot from these resources.
If you have any suggestions or feedback, please feel free to leave a comment or email me at [email protected].