enum.IntEnum in Python Last Updated : 22 Apr, 2020 Comments Improve Suggest changes Like Article Like Report With the help of enum.IntEnum() method, we can get the enumeration based on integer value, if we compare with normal enum based class it will fail by using enum.IntEnum() method. Syntax : enum.IntEnum Return : IntEnum doesn't have a written type. Example #1 : In this example we can see that by using enum.IntEnum() method, we are able to get the enumeration based on integer value by using this method. Python3 1=1 # import enum and IntEnum from enum import IntEnum # Using enum.IntEnum class author(IntEnum): GEEK = 1 FOR = 2 GEEKS = 3 print(author.FOR == 2) OutPut : True Example #2 : Python3 1=1 # import enum and IntEnum from enum import IntEnum, Enum # Using enum.IntEnum class author(IntEnum): GEEK = 1 FOR = 2 GEEKS = 3 class language(Enum): Python = 1 Java = 2 print(author.GEEK == language.Python) OutPut : False Comment More infoAdvertise with us Next Article enum.IntEnum in Python J jitender_1998 Follow Improve Article Tags : Python Python-enum Practice Tags : python Similar Reads enum in Python Enumerations in Python are implemented by using the module named "enum". Enumerations are created using classes. Enums have names and values associated with them. Let's cover the different concepts of Python Enum in this article.What are Enums and Why are they useful?Enumerations or Enums is a set o 6 min read numpy.isinf() in Python numpy.isinf() test element-wise whether a value is positive or negative infinity. It returns a Boolean array with True where the input is either +inf or -inf and False otherwise. Example:Pythonimport numpy as np a = np.array([1, np.inf, -np.inf, 0, np.nan]) res = np.isinf(a) print(res)Output[False T 2 min read numpy.isneginf() in Python The numpy.isneginf() function tests element-wise whether it is negative infinity or not, and returns the result as a boolean array. Syntax :  numpy.isneginf(array, y = None) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity. y : [array_like]A boole 2 min read numpy.identity() in Python numpy.identity() function is used to create an identity matrix which is used to make identity matrix. This is commonly used in linear algebra and numerical computations. It has the following properties:Diagonal elements are all 1s.Non-diagonal elements are all 0s.Syntax: numpy.identity(n, dtype=None 1 min read enum.auto() in Python With the help of enum.auto() method, we can get the assigned integer value automatically by just using enum.auto() method. Syntax : enum.auto()Automatically assign the integer value to the values of enum class attributes.Example #1 : In this example we can see that by using enum.auto() method, we ar 1 min read Like