Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何剥离我将 Unicode 转换为字符串?
df = pd.DataFrame ({'A':[u'Joe', u'Bill']}) test = df['A'] == 'Joe'
这适用于将完整的列转换为 Unicode 到浮点数:
df['B'] = df['B'].astype(float)
但是当我尝试时:
df['A'] = df['A'].astype(str)
输出是:
0 J 1 B
Unicode 是字符串,在那里不需要转换。