Skip to content
Advertisement

unicode argument expected, got ‘str’

I’m using python 2.7.12. Running pd.__version__ returns u’0.19.0′.

I’m using a module called dalmatian. For one of the functions, once I run verbatim what is provided in the documentation, I get the error:

wm.update_participant_set('all_participants', participant_df.index)
TypeError: unicode argument expected, got 'str'

I have an inkling suspicion that this might be due to the version of pandas or python that I’m using. Running participant_df.index returns:

JavaScript

I’ve also tried submitting this as .astype(unicode) and as .index.values. I suppose I don’t really know how to troubleshoot this further. Any thoughts?

EDIT TO INCLUDE TRACEBACK

JavaScript

Advertisement

Answer

I facced same error, the code was written in python 3, but i was running it with python 2. so swiching to python 3 worked for me.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement