original_docstring: Augments a dataframe with the statistics found in this module.
docstring: Augments a dataframe with the statistics found in this module.
docstring_tokens: Augments a dataframe with the statistics found in this module .
code: def augment(dataframe, benchmark=None, column='adj_close', window=21):
      'Augments a dataframe with the statistics found in this module.'
  
      rm = rolling_mean(dataframe[column], window)
      rstd = rolling_std(dataframe[column], window)
      bw = bandwidth(rm, rstd)
      pb = percent_bollinger(dataframe[column], rm, rstd)
      dv = momentum(dataframe[column], window)
      v = volatility(dataframe[column])
  
      dataframe['sma'] = rm
      dataframe['bandwidth'] = bw
      dataframe[r'%b'] = pb
      dataframe['momentum'] = dv
      dataframe['volatility'] = v
  
      if benchmark is not None:
          dataframe['beta'] = beta(dataframe[column], benchmark[column])
  
      return dataframe.ix[TRADING_DAYS_IN_YEAR:]
code_tokens: def augment ( dataframe , benchmark = None , column = 'adj_close' , window = 21 ) : rm = rolling_mean ( dataframe [ column ] , window ) rstd = rolling_std ( dataframe [ column ] , window ) bw = bandwidth ( rm , rstd ) pb = percent_bollinger ( dataframe [ column ] , rm , rstd ) dv = momentum ( dataframe [ column ] , window ) v = volatility ( dataframe [ column ] ) dataframe [ 'sma' ] = rm dataframe [ 'bandwidth' ] = bw dataframe [ r'%b' ] = pb dataframe [ 'momentum' ] = dv dataframe [ 'volatility' ] = v if benchmark is not None : dataframe [ 'beta' ] = beta ( dataframe [ column ] , benchmark [ column ] ) return dataframe . ix [ TRADING_DAYS_IN_YEAR : ]
short_docstring: Augments a dataframe with the statistics found in this module.
short_docstring_tokens: Augments a dataframe with the statistics found in this module .
comment: 'Augments a dataframe with the statistics found in this module.'