Can’t convert np.ndarray of type numpy.bool_
I am wondering why I am getting this error when I used : 

Y_train_class = torch.tensor(Y_train_class.values)



  TypeError: can't convert np.ndarray of type numpy.bool_. The only supported types are: double, float, float16, int64, int32, and uint8.


I have tried to convert my data to float but seems failed

X_train = pd.read_csv('c:/Data/x_train_set_yu.csv', header= None)
Y_train = pd.read_csv('c:/Data/y_train_set_yu.1.csv', header= None)

Y_train_class = (Y_train &gt;= 550)
print (Y_train_class)
X_test = pd.read_csv('c:/Data/X_test.csv',header= None)

X_train = torch.tensor(X_train.values)

Y_train.astype(np.float32)
Y_train_class.astype(np.float32)

Y_train_class = torch.tensor(Y_train_class.values)



  TypeError: can't convert np.ndarray of type numpy.bool_. The only supported types are: double, float, float16, int64, int32, and uint8.


I got this type of error when my Y_train had a string value instead of integers. After replacing strings with integers my error got resolved.
