Returns a numpy boolean array with Trues in the input index 
    positions.
    
    :param index: index array with the Trues positions.
    :type index: ndarray (type=int)
    :param length: Length of the returned array.
    :type length: int or None
    :returns: array with Trues in the input index positions.
    :rtype: ndarray    
    
    .. seealso:: :func:`bool2index`

def index2bool(index, length=None):
    """
    Returns a numpy boolean array with Trues in the input index 
    positions.
    
    :param index: index array with the Trues positions.
    :type index: ndarray (type=int)
    :param length: Length of the returned array.
    :type length: int or None
    :returns: array with Trues in the input index positions.
    :rtype: ndarray    
    
    .. seealso:: :func:`bool2index`
    """
    if index.shape[0] == 0 and length is None:
        return np.arange(0, dtype = bool)
    if length is None: length = index.max()+1
        
    sol = np.zeros(length, dtype=bool)
    sol[index] = True
    return sol