我有一個包含一列的資料框
combine
0 (43,FR,html5 full skinz html5)
1 (43,FR,mobile m-skinz2)
2 (43,FR,mobile m-skinz2 plus)
3 (43,FR,mobile m-skinz2 swipetosite)
我正在尋找一種在組合列中查找字串 S 并獲取其索引的方法。
有什么python函式可以使用嗎?
uj5u.com熱心網友回復:
df.index[df['combine'].str.contains(S, regex=False)].tolist()
這將為您生成一個包含字串 S 的“組合”的索引號串列
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/474528.html
上一篇:在資料框中創建自定義分位數?
