Applied Basic Machine Learning on List of S&P 500 Companies using Yahoo Finance
Basic things you should know:
Use pip command to install missing libaries.
if you are getting key_error try "ABT\n" or "ABT" or use format(ticker.strip()) which will help in passing ticker.
Apply your own theory to improve the algorithm.
Good luck!