<jupyter_start><jupyter_text><jupyter_code>pip install yfinance
import pandas as pd
import yfinance as yf
import datetime
import time
import requests
import io
from google.colab import files 
uploaded=files.upload()
df=pd.read_csv(io.StringIO(uploaded["List of US OTC Stocks.csv"].decode('utf-8')))
Symbols = df['Symbol'].tolist()
start = datetime.datetime(2020,2,1)
end = datetime.datetime(2020,10,11)


# create empty dataframe
stock_final = pd.DataFrame()
# iterate over each symbol
for i in Symbols:  
    
    # print the symbol which is being downloaded
    print( str(Symbols.index(i)) + str(' : ') + i, sep=',', end=',', flush=True)  
    
    try:
        # download the stock price 
        stock = []
        stock = yf.download(i,start=start, end=end, progress=False)
        
        # append the individual stock prices 
        if len(stock) == 0:
            None
        else:
            stock['Name']=i
            stock_final = stock_final.append(stock,sort=False)
    except Exception:
        None
 stock_final.to_csv("OTCStock_dump.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11651376146788991, 'fraction_numerical': 0.014678899082568808, 'mean_word_length': 3.1961538461538463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '276717', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 366, 'n_tokens_neox': 348, 'n_words': 89, 'path': 'OTCDataPull.ipynb', 'repo_name': 'bilaharim/mslearn-tailspin-spacegame-web', 'size': '1090'}