The Pandas package in Python lets us manipulate and analyze large data sets in an efficient manner. Pandas DataFrame is a two-dimensional data structure in form of rows and columns.
This DataFrame.isin()
method filters each element of the DataFrame to check whether it contains the specified value in a particular column.
DataFrame.isin(values)
The DataFrame.isin()
method takes the following value as an argument:
values
: This is the Series, Iterable, List, Tuple, Dictionary, or DataFrame to be searched.This method returns a DataFrame of Boolean values showing whether each element in DataFrame contain a specified argument value.
We discuss isin()
in detail in the code snippet below. We have two different files in this program: main.py
and data.csv
.
Name,Designation,Medical Expenses,Bonus,TOTALRaj,Chief Technical Officer,1250,13100,14350Sharad,Accountant,1250,2300,3550Danish,Senior Web Developer,1250,0,1250Pawan,Senior Ux/Ui Developer,1250,0,1250Rijo Paul,Senior Web Developer,1250,2300,3550Joseph,Senior Web Developer,1250,2300,3550Aakash,Web Developer,1200,0,1200Ganesh,Ux/Ui Designer,1200,0,1200Vinudas,Web Developer,1250,1500,2750Divya,Web Developer,800,0,800Joseph,QAA,774,0,774Sindhu,Web Developer,800,0,800Deepthi,QAA,749,0,749Lijin,Accountant,1000,2000,3000
data.csv
:main.py
:pd.read_csv()
method to read data.csv
in the program as the DataFrame."Joseph"
in the "Name"
column of the above-created DataFrame. isin()
returns a series of Boolean values in the query
variable.