0
$\begingroup$

While loading data using read_sas from sas dataset in Python getting b' along with every string. How can I fix this?

$\endgroup$
0
$\begingroup$

Try using endcoding=utf-8

Code:

import pandas as pd
mydf=pd.read_sas("\home\mypath\mydataset.sas7bdat",format = 'sas7bdat', encoding="utf-8")

If the sas dataset is small, I would recommend loading from CSV file instead of sas dataset. Performance loading from SAS using Python is poor.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.