@@ -922,7 +922,7 @@ def to_hdf(self, path_or_buf, key, **kwargs):
922
922
in the store wherever possible
923
923
fletcher32 : bool, default False
924
924
If applying compression use the fletcher32 checksum
925
- dropna : boolean, default False.
925
+ dropna : boolean, default False.
926
926
If true, ALL nan rows will not be written to store.
927
927
928
928
"""
@@ -1551,7 +1551,8 @@ def select(self, crit, axis=0):
1551
1551
1552
1552
return self .reindex (** {axis_name : new_axis })
1553
1553
1554
- def reindex_like (self , other , method = None , copy = True , limit = None ):
1554
+ def reindex_like (self , other , method = None , copy = True , limit = None ,
1555
+ tolerance = None ):
1555
1556
""" return an object with matching indicies to myself
1556
1557
1557
1558
Parameters
@@ -1560,7 +1561,12 @@ def reindex_like(self, other, method=None, copy=True, limit=None):
1560
1561
method : string or None
1561
1562
copy : boolean, default True
1562
1563
limit : int, default None
1563
- Maximum size gap to forward or backward fill
1564
+ Maximum number of consecutive labels to fill for inexact matches.
1565
+ tolerance : optional
1566
+ Maximum distance between labels of the other object and this
1567
+ object for inexact matches.
1568
+
1569
+ .. versionadded:: 0.17.0
1564
1570
1565
1571
Notes
1566
1572
-----
@@ -1572,7 +1578,8 @@ def reindex_like(self, other, method=None, copy=True, limit=None):
1572
1578
reindexed : same as input
1573
1579
"""
1574
1580
d = other ._construct_axes_dict (axes = self ._AXIS_ORDERS ,
1575
- method = method , copy = copy , limit = limit )
1581
+ method = method , copy = copy , limit = limit ,
1582
+ tolerance = tolerance )
1576
1583
1577
1584
return self .reindex (** d )
1578
1585
@@ -1736,7 +1743,13 @@ def sort_index(self, axis=0, ascending=True):
1736
1743
Value to use for missing values. Defaults to NaN, but can be any
1737
1744
"compatible" value
1738
1745
limit : int, default None
1739
- Maximum size gap to forward or backward fill
1746
+ Maximum number of consecutive elements to forward or backward fill
1747
+ tolerance : optional
1748
+ Maximum distance between original and new labels for inexact
1749
+ matches. The values of the index at the matching locations most
1750
+ satisfy the equation ``abs(index[indexer] - target) <= tolerance``.
1751
+
1752
+ .. versionadded:: 0.17.0
1740
1753
1741
1754
Examples
1742
1755
--------
@@ -1758,6 +1771,7 @@ def reindex(self, *args, **kwargs):
1758
1771
level = kwargs .pop ('level' , None )
1759
1772
copy = kwargs .pop ('copy' , True )
1760
1773
limit = kwargs .pop ('limit' , None )
1774
+ tolerance = kwargs .pop ('tolerance' , None )
1761
1775
fill_value = kwargs .pop ('fill_value' , np .nan )
1762
1776
1763
1777
if kwargs :
@@ -1782,10 +1796,11 @@ def reindex(self, *args, **kwargs):
1782
1796
pass
1783
1797
1784
1798
# perform the reindex on the axes
1785
- return self ._reindex_axes (axes , level , limit ,
1799
+ return self ._reindex_axes (axes , level , limit , tolerance ,
1786
1800
method , fill_value , copy ).__finalize__ (self )
1787
1801
1788
- def _reindex_axes (self , axes , level , limit , method , fill_value , copy ):
1802
+ def _reindex_axes (self , axes , level , limit , tolerance , method ,
1803
+ fill_value , copy ):
1789
1804
""" perform the reinxed for all the axes """
1790
1805
obj = self
1791
1806
for a in self ._AXIS_ORDERS :
@@ -1795,7 +1810,8 @@ def _reindex_axes(self, axes, level, limit, method, fill_value, copy):
1795
1810
1796
1811
ax = self ._get_axis (a )
1797
1812
new_index , indexer = ax .reindex (
1798
- labels , level = level , limit = limit , method = method )
1813
+ labels , level = level , limit = limit , tolerance = tolerance ,
1814
+ method = method )
1799
1815
1800
1816
axis = self ._get_axis_number (a )
1801
1817
obj = obj ._reindex_with_indexers (
@@ -1836,7 +1852,13 @@ def _reindex_multi(self, axes, copy, fill_value):
1836
1852
Broadcast across a level, matching Index values on the
1837
1853
passed MultiIndex level
1838
1854
limit : int, default None
1839
- Maximum size gap to forward or backward fill
1855
+ Maximum number of consecutive elements to forward or backward fill
1856
+ tolerance : optional
1857
+ Maximum distance between original and new labels for inexact
1858
+ matches. The values of the index at the matching locations most
1859
+ satisfy the equation ``abs(index[indexer] - target) <= tolerance``.
1860
+
1861
+ .. versionadded:: 0.17.0
1840
1862
1841
1863
Examples
1842
1864
--------
@@ -2910,7 +2932,7 @@ def interpolate(self, method='linear', axis=0, limit=None, inplace=False,
2910
2932
use the actual numerical values of the index
2911
2933
* 'krogh', 'piecewise_polynomial', 'spline', and 'pchip' are all
2912
2934
wrappers around the scipy interpolation methods of similar
2913
- names. These use the actual numerical values of the index. See
2935
+ names. These use the actual numerical values of the index. See
2914
2936
the scipy documentation for more on their behavior:
2915
2937
http://docs.scipy.org/doc/scipy/reference/interpolate.html#univariate-interpolation
2916
2938
http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html
0 commit comments