January 2020
Beginner to intermediate
432 pages
11h 24m
English
In this recipe, we download Twitter's (adjusted) stock prices for the year 2018. We use Yahoo Finance to download the data, as described in the Getting data from Yahoo Finance recipe, found in Chapter 1, Financial Data and Preprocessing. Follow these steps:
import pandas as pd import yfinance as yf
df_twtr = yf.download('TWTR', start='2018-01-01', end='2018-12-31', progress=False, auto_adjust=True)
For creating the plot, we use the plotly and cufflinks libraries. For more details, please refer to the Visualizing time series data recipe, found in Chapter 1, Financial Data and Preprocessing.
Read now
Unlock full access