By using AWS re:Post, you agree to the Terms of Use

How to convert binary file to pandas dataframe


I use Amazon Sagemaker for model training and prediction. I have a problem with the returned data with predictions. I am trying to convert prediction data to pandas dataframe format.

After the model is deployed:

from sagemaker.serializers import CSVSerializer xgb_predictor=estimator.deploy( initial_instance_count=1, instance_type='ml.g4dn.xlarge', serializer=CSVSerializer() )

I made a prediction on the test data:


But, returned prediction results are in a binary file. This is a sample returned predictions:


How can I convert prediction data to pandas dataframe?

1 Answers


It looks like you have a bytes response, have a look at this post, this will help you with the transform to dataframe.

Hope it helps :)

answered 16 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions