from numpy import array, loadtxt, savetxt

def load_feature_data(fname):
    data = []
    file_data = open(fname)
    for line in file_data:
        line = line.strip().split()
        if 'None' not in line and 'nan' not in line:
            data.append(line[:])
    # data = array(data, dtype=float)
    data = array(data)

    return data

data = load_feature_data('positive_invivo_final.txt')
print data.shape
savetxt('positive_invivo_final.txt.filtered', data, fmt='%s',
        delimiter='\t')
