def get_books_by_publisher(data, ascending=True):
    """Returns the books by each publisher as a pandas series

    Args:
        data: The pandas dataframe to get the from
        ascending: The sorting direction for the returned data.
        Defaults to True.

    Returns:
        The sorted data as a pandas series
    """
    return data.groupby("publisher").size().sort_values(ascending=ascending)