end = datetime.now() start = datetime(end.year-1,end.month,end.day) # In[5]: # Importing Amazon Stock Prices AMZN = DataReader('AMZN','yahoo',start,end) # In[6]: # Some Basic info about the Amazon Stock AMZN.describe() # In[7]: # Plotting Adjusted Closing price for Amazon Stock AMZN['Adj Close'].plot(legend=True,figsize=(10,4)) # In[8]: # Plotting the total volume of stock being traded each day AMZN['Volume'].plot(legend=True,figsize=(10,4))
# Setting the Start and End date for Stock Market Analysis end = datetime.now() start = datetime(end.year - 1, end.month, end.day) # In[5]: # Importing Apple Stock Prices AAPL = DataReader('AAPL', 'yahoo', start, end) # In[6]: # Some Basic info about the Apple Stock AAPL.describe() # In[7]: # Plotting Adjusted Closing price for Apple Stock AAPL['Adj Close'].plot(legend=True, figsize=(10, 4)) # In[8]: # Plotting the total volume of stock being traded each day AAPL['Volume'].plot(legend=True, figsize=(10, 4)) # In[9]:
# Setting the Start and End date for Stock Market Analysis end = datetime.now() start = datetime(end.year - 1, end.month, end.day) # In[7]: # Importing Google Stock Prices GOOG = DataReader('GOOG', 'yahoo', start, end) # In[8]: # Some Basic info about the Google Stock GOOG.describe() # In[9]: # Plotting Adjusted Closing price for Google Stock GOOG['Adj Close'].plot(legend=True, figsize=(10, 4)) # In[10]: # Total volume of stock being traded each day GOOG['Volume'].plot(legend=True, figsize=(10, 4)) # In[11]:
from pandas.io.data import DataReader from datetime import datetime import pandas as pd import numpy as np df = DataReader("GOOG", "yahoo", datetime(2009,1,1), datetime(2013,5,5)) df=df['Open'] df=df.groupby(df.index.map(lambda x: x.year)).mean() print df.describe() print df.to_string
end = datetime.now() start = datetime(end.year-1,end.month,end.day) # In[5]: # Importing Apple Stock Prices AAPL = DataReader('AAPL','yahoo',start,end) # In[6]: # Some Basic info about the Apple Stock AAPL.describe() # In[7]: # Plotting Adjusted Closing price for Apple Stock AAPL['Adj Close'].plot(legend=True,figsize=(10,4)) # In[8]: # Plotting the total volume of stock being traded each day AAPL['Volume'].plot(legend=True,figsize=(10,4))
end = datetime.now() start = datetime(end.year-1,end.month,end.day) # In[7]: # Importing Google Stock Prices GOOG = DataReader('GOOG','yahoo',start,end) # In[8]: # Some Basic info about the Google Stock GOOG.describe() # In[9]: # Plotting Adjusted Closing price for Google Stock GOOG['Adj Close'].plot(legend=True,figsize=(10,4)) # In[10]: # Total volume of stock being traded each day GOOG['Volume'].plot(legend=True,figsize=(10,4))
# Setting the Start and End date for Stock Market Analysis end = datetime.now() start = datetime(end.year - 1, end.month, end.day) # In[6]: # Importing Tesla Motors Stock Prices TSLA = DataReader('TSLA', 'yahoo', start, end) # In[7]: # Some Basic info about the Tesla motors Stock TSLA.describe() # In[8]: # Plotting Adjusted Closing price for Tesla Motors Stock TSLA['Adj Close'].plot(legend=True, figsize=(10, 4)) # In[9]: # Plotting the total volume of stock being traded each day TSLA['Volume'].plot(legend=True, figsize=(10, 4)) # In[10]:
# Setting the Start and End date for Stock Market Analysis end = datetime.now() start = datetime(end.year - 1, end.month, end.day) # In[6]: # Importing ExxonMobil Stock Prices XOM = DataReader('XOM', 'yahoo', start, end) # In[7]: # Some Basic info about the ExxonMobil Stock XOM.describe() # In[8]: # Plotting Adjusted Closing price for ExxonMobil Stock XOM['Adj Close'].plot(legend=True, figsize=(10, 4)) # In[9]: # Plotting the total volume of stock being traded each day XOM['Volume'].plot(legend=True, figsize=(10, 4)) # In[10]:
end = datetime.now() start = datetime(end.year-1,end.month,end.day) # In[5]: # Importing Microsoft Stock Prices MSFT = DataReader('MSFT','yahoo',start,end) # In[6]: # Some Basic info about the Microsoft Stock MSFT.describe() # In[7]: # Plotting Adjusted Closing price for Microsoft Stock MSFT['Adj Close'].plot(legend=True,figsize=(10,4)) # In[8]: # Plotting the total volume of stock being traded each day MSFT['Volume'].plot(legend=True,figsize=(10,4))
end = datetime.now() start = datetime(end.year-1,end.month,end.day) # In[6]: # Importing Tesla Motors Stock Prices TSLA = DataReader('TSLA','yahoo',start,end) # In[7]: # Some Basic info about the Tesla motors Stock TSLA.describe() # In[8]: # Plotting Adjusted Closing price for Tesla Motors Stock TSLA['Adj Close'].plot(legend=True,figsize=(10,4)) # In[9]: # Plotting the total volume of stock being traded each day TSLA['Volume'].plot(legend=True,figsize=(10,4))