IndexError: index 13 is out of bounds for axis 1 with size 1

358 Views Asked by At

I'm facing problem while extracting the data from a given file...

def main():  
    with open('heart_data_norm.txt', 'r') as f:   
        reader = csv.reader(f, delimiter='\t')  
        next(reader, None)  # skip header  
        rows = np.array([r for r in reader])  
        random.shuffle(rows)  # randomly shuffle the data 

    Y=rows[:,13]
    X=rows[:,1:13]
    X = X.astype(np.float32)
    
    
if __name__ == '__main__':
    main()  
0

There are 0 best solutions below