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


Python datetimelike.DatetimeIndexOpsMixin类代码示例

本文整理汇总了Python中pandas.core.indexes.datetimelike.DatetimeIndexOpsMixin的典型用法代码示例。如果您正苦于以下问题:Python DatetimeIndexOpsMixin类的具体用法?Python DatetimeIndexOpsMixin怎么用?Python DatetimeIndexOpsMixin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: _convert_tolerance

 def _convert_tolerance(self, tolerance, target):
     tolerance = DatetimeIndexOpsMixin._convert_tolerance(self, tolerance,
                                                          target)
     if target.size != tolerance.size and tolerance.size > 1:
         raise ValueError('list-like tolerance size must match '
                          'target index size')
     return self._maybe_convert_timedelta(tolerance)
开发者ID:TomAugspurger,项目名称:pandas,代码行数:7,代码来源:period.py

示例2: _addsub_offset_array

 def _addsub_offset_array(self, other, op):
     # Add or subtract Array-like of DateOffset objects
     try:
         # TimedeltaIndex can only operate with a subset of DateOffset
         # subclasses.  Incompatible classes will raise AttributeError,
         # which we re-raise as TypeError
         return DatetimeIndexOpsMixin._addsub_offset_array(self, other, op)
     except AttributeError:
         raise TypeError("Cannot add/subtract non-tick DateOffset to {cls}"
                         .format(cls=type(self).__name__))
开发者ID:tdsmith,项目名称:pandas,代码行数:10,代码来源:timedeltas.py

示例3: astype

 def astype(self, dtype, copy=True):
     dtype = pandas_dtype(dtype)
     if is_timedelta64_dtype(dtype) and not is_timedelta64_ns_dtype(dtype):
         # Have to repeat the check for 'timedelta64' (not ns) dtype
         #  so that we can return a numeric index, since pandas will return
         #  a TimedeltaIndex when dtype='timedelta'
         result = self._data.astype(dtype, copy=copy)
         if self.hasnans:
             return Index(result, name=self.name)
         return Index(result.astype('i8'), name=self.name)
     return DatetimeIndexOpsMixin.astype(self, dtype, copy=copy)
开发者ID:Itay4,项目名称:pandas,代码行数:11,代码来源:timedeltas.py

示例4: _join_i8_wrapper

 def _join_i8_wrapper(joinf, **kwargs):
     return DatetimeIndexOpsMixin._join_i8_wrapper(
         joinf, dtype='m8[ns]', **kwargs)
开发者ID:Itay4,项目名称:pandas,代码行数:3,代码来源:timedeltas.py

示例5: _convert_tolerance

 def _convert_tolerance(self, tolerance):
     tolerance = DatetimeIndexOpsMixin._convert_tolerance(self, tolerance)
     return self._maybe_convert_timedelta(tolerance)
开发者ID:AllenDowney,项目名称:pandas,代码行数:3,代码来源:period.py


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