📜  字符串模式匹配 pandas - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:23.804000             🧑  作者: Mango

代码示例1
#df is a data frame and emails is a column.
emails = df.loc[:, 'EMAIL']
# wanted to filter the data from emais column where email id has gmail in it
gmail_emails = df[emails.str.contains('@gmail')]

#For more information:
https://kanoki.org/2019/11/12/how-to-use-regex-in-pandas/