def validate_axis(axis=0, none_axis=0):
    """ Check the given axis is valid. """
    if axis not in (0, 1, 'index', 'columns', None):
        raise ValueError('No axis named {0}'.format(axis))
    return {None: none_axis, 'index': 0, 'columns': 1}.get(axis, axis)
