本文整理汇总了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)
示例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)
示例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)
示例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)