当前位置: 首页>>代码示例>>Python>>正文


Python cast._int64_max方法代码示例

本文整理汇总了Python中pandas.core.dtypes.cast._int64_max方法的典型用法代码示例。如果您正苦于以下问题:Python cast._int64_max方法的具体用法?Python cast._int64_max怎么用?Python cast._int64_max使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.core.dtypes.cast的用法示例。


在下文中一共展示了cast._int64_max方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_fill_value

# 需要导入模块: from pandas.core.dtypes import cast [as 别名]
# 或者: from pandas.core.dtypes.cast import _int64_max [as 别名]
def _get_fill_value(dtype, fill_value=None, fill_value_typ=None):
    """ return the correct fill value for the dtype of the values """
    if fill_value is not None:
        return fill_value
    if _na_ok_dtype(dtype):
        if fill_value_typ is None:
            return np.nan
        else:
            if fill_value_typ == '+inf':
                return np.inf
            else:
                return -np.inf
    else:
        if fill_value_typ is None:
            return tslibs.iNaT
        else:
            if fill_value_typ == '+inf':
                # need the max int here
                return _int64_max
            else:
                return tslibs.iNaT 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:23,代码来源:nanops.py

示例2: _get_fill_value

# 需要导入模块: from pandas.core.dtypes import cast [as 别名]
# 或者: from pandas.core.dtypes.cast import _int64_max [as 别名]
def _get_fill_value(dtype, fill_value=None, fill_value_typ=None):
    """ return the correct fill value for the dtype of the values """
    if fill_value is not None:
        return fill_value
    if _na_ok_dtype(dtype):
        if fill_value_typ is None:
            return np.nan
        else:
            if fill_value_typ == '+inf':
                return np.inf
            else:
                return -np.inf
    else:
        if fill_value_typ is None:
            return tslib.iNaT
        else:
            if fill_value_typ == '+inf':
                # need the max int here
                return _int64_max
            else:
                return tslib.iNaT 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:23,代码来源:nanops.py

示例3: _wrap_results

# 需要导入模块: from pandas.core.dtypes import cast [as 别名]
# 或者: from pandas.core.dtypes.cast import _int64_max [as 别名]
def _wrap_results(result, dtype):
    """ wrap our results if needed """

    if is_datetime64_dtype(dtype):
        if not isinstance(result, np.ndarray):
            result = tslib.Timestamp(result)
        else:
            result = result.view(dtype)
    elif is_timedelta64_dtype(dtype):
        if not isinstance(result, np.ndarray):

            # raise if we have a timedelta64[ns] which is too large
            if np.fabs(result) > _int64_max:
                raise ValueError("overflow in timedelta operation")

            result = tslib.Timedelta(result, unit='ns')
        else:
            result = result.astype('i8').view(dtype)

    return result 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:22,代码来源:nanops.py

示例4: _wrap_results

# 需要导入模块: from pandas.core.dtypes import cast [as 别名]
# 或者: from pandas.core.dtypes.cast import _int64_max [as 别名]
def _wrap_results(result, dtype):
    """ wrap our results if needed """

    if is_datetime64_dtype(dtype):
        if not isinstance(result, np.ndarray):
            result = lib.Timestamp(result)
        else:
            result = result.view(dtype)
    elif is_timedelta64_dtype(dtype):
        if not isinstance(result, np.ndarray):

            # raise if we have a timedelta64[ns] which is too large
            if np.fabs(result) > _int64_max:
                raise ValueError("overflow in timedelta operation")

            result = lib.Timedelta(result, unit='ns')
        else:
            result = result.astype('i8').view(dtype)

    return result 
开发者ID:nccgroup,项目名称:Splunking-Crime,代码行数:22,代码来源:nanops.py

示例5: _wrap_results

# 需要导入模块: from pandas.core.dtypes import cast [as 别名]
# 或者: from pandas.core.dtypes.cast import _int64_max [as 别名]
def _wrap_results(result, dtype, fill_value=None):
    """ wrap our results if needed """

    if is_datetime64_dtype(dtype) or is_datetime64tz_dtype(dtype):
        if fill_value is None:
            # GH#24293
            fill_value = iNaT
        if not isinstance(result, np.ndarray):
            tz = getattr(dtype, 'tz', None)
            assert not isna(fill_value), "Expected non-null fill_value"
            if result == fill_value:
                result = np.nan
            result = tslibs.Timestamp(result, tz=tz)
        else:
            result = result.view(dtype)
    elif is_timedelta64_dtype(dtype):
        if not isinstance(result, np.ndarray):
            if result == fill_value:
                result = np.nan

            # raise if we have a timedelta64[ns] which is too large
            if np.fabs(result) > _int64_max:
                raise ValueError("overflow in timedelta operation")

            result = tslibs.Timedelta(result, unit='ns')
        else:
            result = result.astype('i8').view(dtype)

    return result 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:31,代码来源:nanops.py


注:本文中的pandas.core.dtypes.cast._int64_max方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。