From 0caebf434724d135ea33cffd752a375b644bf6b0 Mon Sep 17 00:00:00 2001 From: Miles Tiley Date: Fri, 29 Nov 2019 11:03:50 +1100 Subject: [PATCH] Fix FutureWarning in heavy_tails.rst - relates to issue #776 - imports and calls register_matplotlib_converters - adds comment explanation --- source/rst/heavy_tails.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/rst/heavy_tails.rst b/source/rst/heavy_tails.rst index 576fd346..00ce4c1b 100644 --- a/source/rst/heavy_tails.rst +++ b/source/rst/heavy_tails.rst @@ -133,6 +133,13 @@ The code below produces the desired plot using Yahoo financial data via the ``yf import yfinance as yf import pandas as pd + + from pandas.plotting import register_matplotlib_converters + register_matplotlib_converters() + # The two lines above allow us to safely use pandas time series + # methods with a matplotlib plotting method + # This code will work without them (as of pandas v0.25.1) but would + # result in a FutureWarning, and could be broken by pandas updates s = yf.download('AMZN', '2015-1-1', '2019-11-1')['Adj Close']