(X, NaN=0)
return valid_indices
Find good skeletons whose upper body joints don't contain `NaN`.
    Return the indices of these skeletons.
    Arguments:
        X {np.array, shape=NxP}: Feature of each sample. 
            N is number of samples, P is feature dimension.
            P = 36 = 18*2.
        NaN {int}: `Not A Number`, which is the value for invalid data.
Find good skeletons whose upper body joints don't contain `NaN`.
    Return the indices of these skeletons.
    Arguments:
        X {np.array, shape=NxP}: Feature of each sample. 
            N is number of samples, P is feature dimension.
            P = 36 = 18*2.
        NaN {int}: `Not A Number`, which is the value for invalid data.
Find good skeletons whose upper body joints don t contain NaN . Return the indices of these skeletons . Arguments : X { np . array shape = NxP } : Feature of each sample . N is number of samples P is feature dimension . P = 36 = 18 * 2 . NaN { int } : Not A Number which is the value for invalid data .
def _get_skeletons_with_complete_upper_body(X, NaN=0):
    ''' 
    Find good skeletons whose upper body joints don't contain `NaN`.
    Return the indices of these skeletons.
    Arguments:
        X {np.array, shape=NxP}: Feature of each sample. 
            N is number of samples, P is feature dimension.
            P = 36 = 18*2.
        NaN {int}: `Not A Number`, which is the value for invalid data.
    '''

    left_idx, right_idx = 0, 14 * 2  # 1head+1neck+2*(3arms + 3legs)

    def is_valid(x):
        return len(np.where(x[left_idx:right_idx] == NaN)[0]) == 0
    valid_indices = [i for i, x in enumerate(X) if is_valid(x)]
    return valid_indices
def _get_skeletons_with_complete_upper_body ( X , NaN = 0 ) : left_idx , right_idx = 0 , 14 * 2 # 1head+1neck+2*(3arms + 3legs) def is_valid ( x ) : return len ( np . where ( x [ left_idx : right_idx ] == NaN ) [ 0 ] ) == 0 valid_indices = [ i for i , x in enumerate ( X ) if is_valid ( x ) ] return valid_indices