Python | Pandas Series.str.isdecimal() Last Updated : 28 Sep, 2018 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 isdecimal() is used to check whether all characters in a string are decimal. This method works in a similar way to str.isdigit() method, but there is a difference that the latter is more expansive with respect to non ASCII digits. This will be cleared with the help of an example. Syntax: Series.str.isdecimal() Return type: Boolean series Example #1: In this example, a new data frame is created with just one column and some values are passed to it. Then str.isdecimal() method is called on that column and output is returned to a new column Bool. Python3 1== # importing pandas module import pandas as pd # creating data frame data = pd.DataFrame(["hey", "gfg", 3, "4", 5, "5.5"]) # calling method and returning series data["Bool"]= data[0].str.isdecimal() # display data Output: As shown in the output image, the decimal returns True for decimal values in string form. If the element is in int, float or any other data type other than string, NaN is returned ( No matter if it's a decimal number ) Example #2: In this example, numbers with power are also added to that column. Both str isdigit() and str.isdecimal() are called and output is stored in different columns to compare the difference between both. Python3 1== # importing pandas module import pandas as pd # creating data frame data = pd.DataFrame(["hey", "gfg", 3, "4²", 5, "5.5", "129²"]) # calling method and returning series data["Bool"]= data[0].str.isdecimal() # calling method and returning series data["Bool2"]= data[0].str.isdigit() # display data Output: As shown in the Output image, the isdigit () returns True for numbers with power but isdecimal () returns False for those values. Comment More infoAdvertise with us Next Article Python | Pandas Series.str.isdecimal() K Kartikaybhutani Follow Improve Article Tags : Misc Python Python-pandas Python pandas-series Python pandas-series-methods Python-pandas-series-str +2 More Practice Tags : Miscpython Similar Reads Python | Pandas Series.str.isdigit() 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 str.isdigit() method is used to check if all characters in each string in serie 2 min read Python | Pandas Series.str.isalpha() 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 str.isalpha() method is used to check if all characters in each string in the s 2 min read Python | Pandas Series.str.index() 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 str.index() method is used to search and return lowest index of a substring in 3 min read Python | Pandas Series.str.decode() Series.str can be used to access the values of the series as strings and apply several methods to it. Pandas Series.str.decode() function is used to decode character string in the Series/Index using indicated encoding. This function is equivalent to str.decode() in python2 and bytes.decode() in pyth 2 min read Python | Pandas Series.str.len() 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 str.len() method is used to determine length of each string in a Pandas series. 3 min read Like