def sma(eqdata, **kwargs):
if len(eqdata.shape) > <NUM_LIT:1> and eqdata.shape[<NUM_LIT:1>] != <NUM_LIT:1>:<EOL><INDENT>_selection = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>_eqdata = eqdata.loc[:, _selection]<EOL><DEDENT>else:<EOL><INDENT>_eqdata = eqdata<EOL><DEDENT>_window = kwargs.get('<STR_LIT>', <NUM_LIT:20>)<EOL>_outputcol = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>ret = pd.DataFrame(index=_eqdata.index, columns=[_outputcol], dtype=np.float64)<EOL>ret.loc[:, _outputcol] = _eqdata.rolling(window=_window, center=False).mean().values.flatten()<EOL>return ret<EOL>
simple moving average 

Parameters
----------
eqdata : DataFrame
window : int, optional
    Lookback period for sma. Defaults to 20.
outputcol : str, optional
    Column to use for output. Defaults to 'SMA'.
selection : str, optional
    Column of eqdata on which to calculate sma. If
    `eqdata` has only 1 column, `selection` is ignored,
    and sma is calculated on that column. Defaults
    to 'Adj Close'.