Python | Pandas Index.isin() Last Updated : 16 Jan, 2022 Comments Improve Suggest changes Like Article Like Report Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.isin() function return a boolean array where the index values are in values. compute boolean array of whether each index value is found in the passed set of values. The length of the returned boolean array matches the length of the index. Syntax: Index.isin(values, level=None)Parameters : values : [set or list-like] Sought values. level : Name or position of the index level to use (if the index is a MultiIndex).Returns : NumPy array of boolean values. Example #1: Use Index.isin() function to check if the index value is present in the passed list of values. Python3 # importing pandas as pd import pandas as pd # Creating the Index idx = pd.Index(['Labrador', 'Beagle', 'Mastiff', 'Lhasa', 'Husky', 'Beagle']) # Print the Index idx Output : Now we find if index labels are present in the passed list. Python3 # Passing a list containing two values against # which the index labels will be matched idx.isin(['Lhasa', 'Mastiff']) Output : The function returned an array object having the same size as that of the index. True value means the index label was present in the passed list object and False value means the index label was not present in the passed list object. Example #2: Use Index.isin() function to check if the labels of MultiIndex are present in the passed list. Python3 # importing pandas as pd import pandas as pd # Creating the MultiIndex midx = pd.MultiIndex.from_arrays([['Mon', 'Tue', 'Wed', 'Thr'], [10, 20, 30, 40]], names =('Days', 'Target')) # Print the MultiIndex midx Output : Now we will check if the labels in the MultiIndex are present in the passed list or not. Python3 # test whether midx labels are in list or not midx.isin(['Tue', 'Wed', 'Fri', 'Sat'], level ='Days') Output : As we can see in the output, the function has returned an array object having the same size as that of the MultiIndex selected level. True value means the index label was present in the passed list object and False value means the index label was not present in the passed list object. Comment More infoAdvertise with us Next Article Python | Pandas Index.isin() S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Python pandas-indexing Practice Tags : python Similar Reads Python | Pandas Index.isna() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.isna() function detect missing values. It return a boolean same-sized obj 2 min read Python | Pandas Index.min() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.min() function returns the minimum value of the Index. The function works 2 min read Python | Pandas Index.isnull() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.isnull() function detect missing values. It return a boolean same-sized o 2 min read Python | Pandas Index.insert() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.insert() function make new Index inserting new item at location. This fun 2 min read Python | Pandas Index.ndim Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects. Pandas Index.ndim attribute return the number of dimensions of the underlying data in the given Index object. By definition it is 1. Syntax: Index. 2 min read Python | Pandas Index.itemsize Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects. Pandas Index.itemsize attribute return the size of the dtype of the items of the underlying data in the given Index object. Syntax: Index.itemsize 2 min read Python | Pandas Index.notna() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.Pandas Index.notna() function Detect existing (non-missing) values. Return a boolean sa 2 min read Python | Pandas Index.intersection() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.intersection() function form the intersection of two Index objects. This 2 min read Python | Pandas Index.max() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.max() function returns the maximum value of the Index. The function works 2 min read Python | Pandas Index.nbytes Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects. Pandas Index.nbytes attribute return the number of bytes required to store the underlying data of the given Index object. Syntax: Index.nbytes Para 2 min read Like