def ratio_to_ave(window, eqdata, **kwargs):
_selection = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>_skipstartrows = kwargs.get('<STR_LIT>', <NUM_LIT:0>)<EOL>_skipendrows = kwargs.get('<STR_LIT>', <NUM_LIT:0>)<EOL>_outputcol = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>_size = len(eqdata.index)<EOL>_eqdata = eqdata.loc[:, _selection]<EOL>_sma = _eqdata.iloc[:-<NUM_LIT:1> - _skipendrows].rolling(window=window, center=False).mean().values<EOL>_outdata = _eqdata.values[window + _skipstartrows:_size - _skipendrows] /_sma[window + _skipstartrows - <NUM_LIT:1>:]<EOL>_index = eqdata.index[window + _skipstartrows:_size - _skipendrows]<EOL>return pd.DataFrame(_outdata, index=_index, columns=[_outputcol], dtype=np.float64)<EOL>
Return values expressed as ratios to the average over some number
of prior sessions.

Parameters
----------
eqdata : DataFrame
    Must contain a column with name matching `selection`, or, if
    `selection` is not specified, a column named 'Volume'
window : int
    Interval over which to calculate the average. Normally 252 (1 year)
selection : str, optional
    Column to select for calculating ratio. Defaults to 'Volume'
skipstartrows : int, optional
    Rows to skip at beginning in addition to the `window` rows
    that must be skipped to get the baseline volume. Defaults to 0.
skipendrows : int, optional
    Rows to skip at end. Defaults to 0.
outputcol : str, optional
    Name of column in output dataframe. Defaults to 'Ratio to Ave'

Returns
---------
out : DataFrame