def ncols(series):
    """
    Determine # of columns
    """
    if not hasattr(series, 'shape'):
        return 1
    if len(series.shape) == 1:
        return 1
    else:
        return series.shape[1]
