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


Python Index.get_indexer方法代码示例

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


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

示例1: get_indexer

# 需要导入模块: from pandas.tseries.index import Index [as 别名]
# 或者: from pandas.tseries.index.Index import get_indexer [as 别名]
    def get_indexer(self, target, method=None, limit=None, tolerance=None):
        target = _ensure_index(target)

        if hasattr(target, 'freq') and target.freq != self.freq:
            msg = _DIFFERENT_FREQ_INDEX.format(self.freqstr, target.freqstr)
            raise IncompatibleFrequency(msg)

        if isinstance(target, PeriodIndex):
            target = target.asi8

        if tolerance is not None:
            tolerance = self._convert_tolerance(tolerance)
        return Index.get_indexer(self._int64index, target, method,
                                 limit, tolerance)
开发者ID:clwater,项目名称:lesson_python,代码行数:16,代码来源:period.py

示例2: get_indexer

# 需要导入模块: from pandas.tseries.index import Index [as 别名]
# 或者: from pandas.tseries.index.Index import get_indexer [as 别名]
 def get_indexer(self, target, method=None, limit=None, tolerance=None):
     if hasattr(target, 'freq') and target.freq != self.freq:
         msg = _DIFFERENT_FREQ_INDEX.format(self.freqstr, target.freqstr)
         raise IncompatibleFrequency(msg)
     return Index.get_indexer(self, target, method, limit, tolerance)
开发者ID:DGrady,项目名称:pandas,代码行数:7,代码来源:period.py

示例3: get_indexer

# 需要导入模块: from pandas.tseries.index import Index [as 别名]
# 或者: from pandas.tseries.index.Index import get_indexer [as 别名]
 def get_indexer(self, target, method=None, limit=None):
     if hasattr(target, 'freq') and target.freq != self.freq:
         raise ValueError('target and index have different freq: '
                          '(%s, %s)' % (target.freq, self.freq))
     return Index.get_indexer(self, target, method, limit)
开发者ID:Arthurkorn,项目名称:pandas,代码行数:7,代码来源:period.py

示例4: get_indexer

# 需要导入模块: from pandas.tseries.index import Index [as 别名]
# 或者: from pandas.tseries.index.Index import get_indexer [as 别名]
 def get_indexer(self, target, method=None, limit=None, tolerance=None):
     if hasattr(target, "freq") and target.freq != self.freq:
         raise ValueError("target and index have different freq: " "(%s, %s)" % (target.freq, self.freq))
     return Index.get_indexer(self, target, method, limit, tolerance)
开发者ID:troglotit,项目名称:pandas,代码行数:6,代码来源:period.py


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