當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。