Search
 
SCRIPT & CODE EXAMPLE
 

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/
Comment

PREVIOUS NEXT
Code Example
Python :: subtract one list from another python 
Python :: Extract Date from Datetime object 
Python :: create np nan array 
Python :: tkinter hover button 
Python :: matplotlib boxplot remove outliers 
Python :: how to split image dataset into training and test set keras 
Python :: docker pyinstaller windowa 
Python :: convert hex to decimal python 
Python :: drop a column from dataframe 
Python :: google translate with python 
Python :: download files requests python 
Python :: how to change the column order in pandas dataframe 
Python :: how to find columns of a dataframe 
Python :: print multiplication table of a number 
Python :: scanning 2d array in python 
Python :: import stopwords 
Python :: getting image from path python 
Python :: number 1 
Python :: make a specific column a df index 
Python :: matplotlib transparent line 
Python :: error bar plot python 
Python :: how to add up everything in a list python 
Python :: import random py 
Python :: creating virtual environment python 
Python :: django models distinct 
Python :: How to get the current user email from the account logged in? odoo 
Python :: delete rows in dataframe pandas 
Python :: set text and background color in pandas table 
Python :: pandas add rows from df to another 
Python :: matplotlib rc params 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =