def indexed_view(indx, ndarray, axis):
    """Return last view along specified axis
    E.g. ndarray[:,:,indx,:] if axis=2

    :indx:
    :ndarray: 
    :axis:
    :returns: ndarray

    """
    n=ndarray.ndim
    pretuple=[slice(None)]*ndarray.ndim
    pretuple[axis]=indx
    return ndarray[tuple(pretuple)]