The other day, I summarized the basic Pandas condition extraction. [https://qiita.com/M_Faust/items/05a79e0372bf9c9003e5][1] [1]:https://qiita.com/M_Faust/items/05a79e0372bf9c9003e5
The condition extraction when a specific character string is included for the DataFrame whose type is a character string is as follows.
Condition extraction when a specific character string is included
>>> df = pd.DataFrame ({"A":["hello","helloa","ahello","bye"]})
>>> df_extract = df.query ("A.str.contains ('hello')",engine="python")
>>> df_extract
A
0 hello
1 helloa
2 ahello
I run an app that makes money for environmental beautification activities (I will post it because Python is used in Backend). [https://play.google.com/store/apps/details?id=com.rainbowsv2.changetheworld&hl=ja][2] [2]:https://play.google.com/store/apps/details?id=com.rainbowsv2.changetheworld&hl=ja
Recommended Posts