1
我想選擇一個熊貓數據框df
的子集,其中列text
的值爲'0.0, 0.0'
。我以爲這個命令將是df.ix[df['text'] == "0.0, 0.0"]
,但這返回使用熊貓進行條件行選擇
<console>:1: error: identifier expected but symbol literal found.
df.ix[df['text'] == "0.0, 0.0"]
^
<console>:1: error: unclosed character literal
df.ix[df['text'] == "0.0, 0.0"]
^
我做錯了什麼?
您是否修改了錯誤信息的任何部分? – ayhan
不,我沒有更改錯誤信息 –
當我嘗試它時它工作正常。你可以添加你的Python/pandas安裝版本,你正在使用的環境等? – ayhan