2013-05-05 63 views
0

如何將Unicode轉換爲字符串?在Python中轉換爲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 
+0

Unicode字符串是字符串。他們是否對您造成問題? – Blender 2013-05-05 19:22:34

回答

0

Unicode是字符串,不需要轉換回覆。

+0

好的,謝謝我真的不知道他們是什麼。 – user2333196 2013-05-05 19:46:33