Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

string pattern matching pandas

#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/
 
PREVIOUS NEXT
Tagged: #string #pattern #matching #pandas
ADD COMMENT
Topic
Name
3+6 =