I am new to python programming. Following the AWS learning path:
I am getting an error when excuting the following block (in conda_python3):
test_data_array = test_data.drop(['y_no', 'y_yes'], axis=1).values #load the data into an array
xgb_predictor.content_type = 'text/csv' # set the data type for an inference
xgb_predictor.serializer = csv_serializer # set the serializer type
predictions = xgb_predictor.predict(test_data_array).decode('utf-8') # predict!
predictions_array = np.fromstring(predictions[1:], sep=',') # and turn the prediction into an
array
print(predictions_array.shape)
AttributeError Traceback (most recent call last) in 1 test_data_array = test_data.drop(['y_no', 'y_yes'], axis=1).values #load the data into an array ----> 2 xgb_predictor.content_type = 'text/csv' # set the data type for an inference 3 xgb_predictor.serializer = csv_serializer # set the serializer type 4 predictions = xgb_predictor.predict(test_data_array).decode('utf-8') # predict! 5 predictions_array = np.fromstring(predictions[1:], sep=',') # and turn the prediction into an array
AttributeError: can't set attribute
I have looked at several prior questions but couldn't find much information related to this error when it comes to creating data types.
Thanks in advance for any help.