def get_mean(dataframe, column, by=None):
    """ Return mean values of column x (optionally grouped)
    
    :param dataframe: Data
    :type dataframe: pandas.Dataframe
    :param column: Column name
    :type column: str
    :param by: Column names by which to group.
    :type by: str|list
    :return: mean value, optionally for each group.
    :rtype: numpy.float64|pandas.Series
    """
    if by is None:
        means = dataframe[column].mean()
    else:
        means = dataframe.groupby(by, observed=True)[column].mean()
    return means