本文整理匯總了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)