Answers for "import stock data in python"

4

python get stock data

import yfinance as yf
import matplotlib.pyplot as plt
# Get the data for the stock Apple by specifying the stock ticker, start date, and end date
data = yf.download('AAPL','2016-01-01','2018-01-01') 
# Plot the close prices
data.Close.plot()
plt.show()
Posted by: Guest on April-22-2020
1

get stock data in python

# First run 'python -m pip install yahoofinancials'

from yahoofinancials import YahooFinancials

yf = YahooFinancials('WFC')
print(yf.get_current_price())
print(yf.get_prev_close_price())
Posted by: Guest on January-04-2022

Python Answers by Framework

Browse Popular Code Answers by Language