Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data column conversion to string issue

Status
Not open for further replies.

Evecuz

Systems Engineer
Mar 13, 2018
2
CA
Hello guys!

I have converted the data type column from object to string in a dataframe with data loaded from an excel file loaded with pd.read_excel(....

df_list["País"]=df_list["País"].astype("string"). It works OK.

However, when I list the content of column it shows me the strings with a b' prefix in strings.

I have tried to convert from byte-string to string using:

df_list["País"]=df_list["País"].str.decode("utf-8") but I get this msg error: AttributeError: 'str' object has no attribute 'decode'

I will appreciate any help.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top