I have the following code:
import pandas as pd
from pandas_datareader import data as web
import datetime
df = web.DataReader('tip', 'yahoo', start= '1,1,2017', end = datetime.datetime.today())
df1 = df.resample('W-Mon').mean()
df1["Adj Close"].pct_change().plot()
This produces this plot:
To plot in stem in pandas:
df1["Adj Close"].pct_change().stem()
Is producing this error:
AttributeError: 'Series' object has no attribute 'stem'
CodePudding user response:
You could use matplotlib:
import matplotlib.pyplot as plt
plt.stem(df1["Adj Close"].pct_change().index,
df1["Adj Close"].pct_change())
plt.show()
Then customise axis/title as you like.


