1. # QuantBook Analysis Tool
  2. # For more information see [https://www.quantconnect.com/docs/research/overview]
  3. qb = QuantBook()
  4. spy = qb.AddEquity("SPY")
  5. #history = qb.History(qb.Securities.Keys, 360, Resolution.Daily)
  6. # Create a 14 period RSI indicator
  7. rsi = RelativeStrengthIndex(14)
  8. df_rsi = qb.Indicator(rsi, spy.Symbol, 180, Resolution.Daily)
  9. df_rsi.drop(['averageloss', 'averagegain'], axis=1, inplace=True).plot()
  1. ---------------------------------------------------------------------------
  2. AttributeError Traceback (most recent call last)
  3. <ipython-input-48-07024c2ec349> in <module>
  4. 10
  5. 11 df_rsi = qb.Indicator(rsi, spy.Symbol, 180, Resolution.Daily)
  6. ---> 12 df_rsi.drop(['averageloss', 'averagegain'], axis=1, inplace=True).plot()
  7. 13
  8. 14
  9. AttributeError: 'NoneType' object has no attribute 'plot'

It works if I change inplace=False. 

158108_1624987849.jpg

Why? 

Where to find reference on setting inplace value in drop method? 

Thanks

Author

Ruming Jiang

June 2021