我的一个pandas dataframe列有这种类型的unicodeu'asd,abc,tre,der34,whatever'
。最后的结果应该是一列字符串:['asd','abc','tre','der34','whatever']
。独角兽的列表也可以:[u'asd',u'abc',u'tre',u'der34',u'whatever']
。
顺便说一句,tt可以发生在unicodes列中有一个nan或一个u''。
有什么建议吗?我知道我可以做str(df['column'].iloc[0]).split(',')
和手动添加一个新的列或做一些更棘手的事情,但我正在寻找更Python。
这个解决方案似乎有效:
这应该是可行的,如果有nan或空字符串,您将不得不处理,无论您认为合适。
相关问题 更多 >
编程相关推荐