TimedeltaIndex.get_indexer(target, method=None, limit=None, tolerance=None) Compute indexer and mask for new index given the current index. The indexer should be then used as an input to ndarray.take to align the current data to the new index.
| Parameters: |
target : Index method : {None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional
limit : int, optional Maximum number of consecutive labels in tolerance : optional Maximum distance between original and new labels for inexact matches. The values of the index at the matching locations most satisfy the equation New in version 0.17.0. |
|---|---|
| Returns: |
indexer : ndarray of int Integers from 0 to n - 1 indicating that the index at these positions matches the corresponding target values. Missing values in the target are marked by -1. |
>>> indexer = index.get_indexer(new_index) >>> new_values = cur_values.take(indexer)
© 2011–2012 Lambda Foundry, Inc. and PyData Development Team
© 2008–2011 AQR Capital Management, LLC
© 2008–2014 the pandas development team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.18.1/generated/pandas.TimedeltaIndex.get_indexer.html