Python | Pandas Index.dropna() Last Updated : 12 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.dropna() function return Index without NA/NaN values. All the missing values are removed and a new object is returned which does not have any NaN values present in it. Syntax: Index.dropna(how='any') Parameters : how : {‘any’, ‘all’}, default ‘any’ If the Index is a MultiIndex, drop the value when any or all levels are NaN. Returns : valid : Index Example #1: Use Index.dropna() function to remove all missing values from the given Index containing datetime data. Python3 # importing pandas as pd import pandas as pd # Creating the Index idx = pd.Index(['2015-10-31', '2015-12-02', None, '2016-01-03', '2016-02-08', '2017-05-05', None, '2014-02-11']) # Print the Index idx Output : Let's drop all the NaN values from the Index. Python3 # drop all missing values. idx.dropna(how ='all') Output : As we can see in the output, the Index.dropna() function has removed all the missing values. Example #2: Use Index.dropna() function to delete all the missing values in the Index. Index contains string type data. Python3 # importing pandas as pd import pandas as pd # Creating the Index idx = pd.Index(['Jan', 'Feb', 'Mar', None, 'May', 'Jun', None, 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']) # Print the Index idx Output : Let's drop all the missing values. Python3 # drop the missing values idx.dropna(how ='any') Output : As we can see in the output all missing values of months has been removed. Comment More infoAdvertise with us Next Article Python | Pandas Index.dropna() S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Technical Scripter 2018 Python-pandas Python pandas-indexing +1 More Practice Tags : python Similar Reads Python | Pandas Index.drop() 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.drop() function make new Index with passed list of labels deleted. The fu 2 min read Python | Pandas Index.data 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.data attribute return the data pointer of the underlying data of the given Index object. Syntax: Index.data Parameter : None Returns : 2 min read Python | Pandas Index.copy() 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.copy() function make a copy of this object. The function also sets the na 2 min read Python | Pandas Index.all() 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.all() function checks if all the elements in the index are true or not. I 2 min read Python | Pandas Index.dtype 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.dtype attribute return the data type (dtype) of the underlying data of the given Index object. Syntax: Index.dtype Parameter : None Re 2 min read Python | Pandas Index.any() 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.any() function checks if any of the elements in the index are true or not 2 min read Python | Pandas Index.fillna() 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.fillna() function fill NA/NaN values with the specified value. It only tak 2 min read Python | Pandas Index.argmin() 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.argmin() function returns the indices of the minimum value present in the 2 min read Python | Pandas Index.append() Python is an excellent language for data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas are one of those packages, making importing and analyzing data much easier. Pandas Index.append() The function is used to append a single or a collection of indices 2 min read Python | Pandas Index.argmax() 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.argmax() function returns the indices of the maximum value present in the 2 min read Like