I'm quite new to pandas (and coding in general), but am really enjoying messing around with pulling stock data from Yahoo Finance.
I was just wondering if there's a way to also pull the name of the exchange that the stock is listed on (i.e. LSE, NYSE, AIM etc), as well as the currency the stock is listed in from Yahoo?
This is my code so far (I'll work on adding some axis labels when I'm back from work tonight):
import pandas as pd
import sys
import matplotlib
import matplotlib.pyplot as plt
import pandas_datareader.data as web
print('Python version ' + sys.version)
print('Pandas version ' + pd.__version__)
print('Matplotlib version ' + matplotlib.__version__)
symbols_list = ['ORCL', 'AAPL', 'TSLA']
d = {}
for x in symbols_list:
d[x] = web.DataReader(x, "yahoo", '2012-12-01')
ticker = pd.Panel(d)
df1 = ticker.minor_xs('Adj Close')
print df1
fig = plt.figure()
fig.suptitle("Stock Prices", fontsize=36, fontweight='bold')
plt.plot(df1)
plt.legend(ticker, loc='best', shadow=True, fontsize=36)
plt.show()