Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

Commit 0caebf4

Browse files
committed
Fix FutureWarning in heavy_tails.rst - relates to issue #776
- imports and calls register_matplotlib_converters - adds comment explanation
1 parent fd6336f commit 0caebf4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/rst/heavy_tails.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ The code below produces the desired plot using Yahoo financial data via the ``yf
133133
134134
import yfinance as yf
135135
import pandas as pd
136+
137+
from pandas.plotting import register_matplotlib_converters
138+
register_matplotlib_converters()
139+
# The two lines above allow us to safely use pandas time series
140+
# methods with a matplotlib plotting method
141+
# This code will work without them (as of pandas v0.25.1) but would
142+
# result in a FutureWarning, and could be broken by pandas updates
136143
137144
s = yf.download('AMZN', '2015-1-1', '2019-11-1')['Adj Close']
138145

0 commit comments

Comments
 (0)