'Sets the average value of a row (or column).
:param i: a row (or column)
:type i: user or item id
:param avg: the average value (if None, it computes *average(i)*)
:type avg: float
:param is_row: is param *i* a row (or a col)?
:type is_row: Boolean'

def set_mean(self, i, avg=None, is_row=True):

    d = self._mean_row
    if (not is_row):
        d = self._mean_col
    if (avg is None):
        m = self._matrix.get().row_named
        if (not is_row):
            m = self._matrix.get().col_named
        avg = mean(m(i))
    d[i] = avg
