def shift ( self , m : Union [ float , pd . Series ] ) -> Union [ int , pd . Series ] : out = m % 1 * self . TEN_DIGIT_MODULUS // 1 if isinstance ( out , pd . Series ) : return out . astype ( int ) return int ( out )
restrict float number to fixed decimal in python for series
Shifts floats so that the first 10 decimal digits are significant .
def shift(self, m: Union[float, pd.Series]) -> Union[int, pd.Series]:
        """Shifts floats so that the first 10 decimal digits are significant."""
        out = m % 1 * self.TEN_DIGIT_MODULUS // 1
        if isinstance(out, pd.Series):
            return out.astype(int)
        return int(out)