<jupyter_start><jupyter_text>DRY Approach<jupyter_code>!pip install yahoo_fin
import yahoo_fin.stock_info as si
import pandas as pd
# get all historical dividend data
MSFT = si.get_quote_table('msft')['1y Target Est']

MSFT
AAPL = si.get_quote_table('aapl')['1y Target Est']

TSLA = si.get_quote_table('TSLA')['1y Target Est']

WOW =  si.get_quote_table('wow.ax')['1y Target Est']

Barclays = si.get_quote_table('BARC.L')['1y Target Est']

print(AAPL,TSLA,WOW,Barclays)<jupyter_output><empty_output><jupyter_text>Loop<jupyter_code>tickers = ['msft', 'aapl', 'TSLA', 'wow.ax', 'BARC.L', 'NAB.AX']
data = {}

for i in tickers:
  data[i] = si.get_quote_table(i)['1y Target Est']
  
stocks = pd.DataFrame(list(data.items()),columns = ['symbol','Target'])
stocks<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16899618805590852, 'fraction_numerical': 0.007623888182973317, 'mean_word_length': 7.208333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '54455', 'license': 'MIT', 'n_tokens_mistral': 342, 'n_tokens_neox': 328, 'n_words': 58, 'path': '13_ControlFlow_Introduction.ipynb', 'repo_name': 'Rizwan-Ahmed-Surhio/Accountants', 'size': '787'}