(self)
return dtype
Return minimal int type to fit all categories.
Return minimal int type to fit all categories.
Return minimal int type to fit all categories .
def int_type(self):
        """
        Return minimal int type to fit all categories.
        """
        dtype = types.int64
        n_cats = len(self.categories)
        if n_cats < np.iinfo(np.int8).max:
            dtype = types.int8
        elif n_cats < np.iinfo(np.int16).max:
            dtype = types.int16
        elif n_cats < np.iinfo(np.int32).max:
            dtype = types.int32
        return dtype
def int_type ( self ) : dtype = types . int64 n_cats = len ( self . categories ) if n_cats < np . iinfo ( np . int8 ) . max : dtype = types . int8 elif n_cats < np . iinfo ( np . int16 ) . max : dtype = types . int16 elif n_cats < np . iinfo ( np . int32 ) . max : dtype = types . int32 return dtype