str.contains
can be used to perform either substring searches or regex based search. The search defaults to regex-based unless you explicitly disable it.
Sometimes regex search is not required, so specify regex=False to disable it.
#select all rows containing "finalAward_band"
df1[df1['col'].str.contains('finalAward_band', regex=False)]
# same as df1[df1['col'].str.contains('finalAward_band')] but faster.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.