Feature Engineering for Pairs Trading

Hi, I created the matrix with the stocks of S&P 500 index and theire percentage change, from yahoo finance data. Now I don't know how I can calculate the fundamental data (profit margins, revenue growth and return on equity), to added in the matrix: is it possible extract the data from yahoo finance and how?

Hi Alessandro,



You can extract the fundamental data from Yahoo finance using yfinance library. 



Link: https://pypi.org/project/yfinance/



Thanks,

Akshay