2
如何在使用熊貓的每一列上搜索字符串值。 可以說我有32列,如何使用熊貓在整個數據框中搜索部分字符串?
df[df['A'].str.contains("hello")]
這個返回值是否出現在「A」柱與否,如何每列中的值是存在的行上進行搜索。 數據集:
A B C
1 hi hie
2 bye Hello
如果我搜索 「你好」 或 「Hello」 的輸出應該是:
A B C
2 bye Hello
「類型錯誤:(「類型'float'的參數不可迭代',在索引Account_Name'發生') [完成於0.3s退出代碼1]「---->出現此錯誤。 – Sidhartha
區分大小寫。如何解決區分大小寫的部分? – Sidhartha
你認爲不敏感嗎?你可以給我的樣品,並添加它的問題? – jezrael