Skip to content

Commit 9909d8a

Browse files
committed
DOC: docs for limit param, #825
1 parent 50bae97 commit 9909d8a

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

pandas/core/frame.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,8 @@ def reindex(self, index=None, columns=None, method=None, level=None,
18631863
fill_value : scalar, default np.NaN
18641864
Value to use for missing values. Defaults to NaN, but can be any
18651865
"compatible" value
1866+
limit : int, default None
1867+
Maximum size gap to forward or backward fill
18661868
18671869
Examples
18681870
--------
@@ -1909,6 +1911,8 @@ def reindex_axis(self, labels, axis=0, method=None, level=None, copy=True,
19091911
level : int or name
19101912
Broadcast across a level, matching Index values on the
19111913
passed MultiIndex level
1914+
limit : int, default None
1915+
Maximum size gap to forward or backward fill
19121916
19131917
Examples
19141918
--------
@@ -1983,6 +1987,8 @@ def reindex_like(self, other, method=None, copy=True, limit=None):
19831987
other : DataFrame
19841988
method : string or None
19851989
copy : boolean, default True
1990+
limit : int, default None
1991+
Maximum size gap to forward or backward fill
19861992
19871993
Notes
19881994
-----
@@ -2437,6 +2443,8 @@ def fillna(self, value=None, method='pad', axis=0, inplace=False,
24372443
other views on this DataFrame, like if you took a no-copy slice of
24382444
an existing DataFrame, for example a column in a DataFrame. Returns
24392445
a reference to the filled object, which is self if inplace=True
2446+
limit : int, default None
2447+
Maximum size gap to forward or backward fill
24402448
24412449
See also
24422450
--------

pandas/core/index.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ class Index(np.ndarray):
5858
----
5959
An Index instance can **only** contain hashable objects
6060
"""
61-
# _algos = {
62-
# 'groupby' : _gin.groupby_index,
63-
# }
64-
6561
# Cython methods
6662
_groupby = lib.groupby_object
6763
_arrmap = lib.arrmap_object
@@ -983,8 +979,6 @@ def copy(self, order='C'):
983979

984980
class Int64Index(Index):
985981

986-
# _is_monotonic = lib.is_monotonic_int64
987-
988982
_groupby = lib.groupby_int64
989983
_arrmap = lib.arrmap_int64
990984
_left_indexer = lib.left_join_indexer_int64
@@ -1172,8 +1166,6 @@ class DatetimeIndex(Int64Index):
11721166
time on or just past end argument
11731167
"""
11741168

1175-
# _is_monotonic = _wrap_i8_function(lib.is_monotonic_int64)
1176-
11771169
_inner_indexer = _join_i8_wrapper(lib.inner_join_indexer_int64)
11781170
_outer_indexer = _join_i8_wrapper(lib.outer_join_indexer_int64)
11791171
_left_indexer = _join_i8_wrapper(lib.left_join_indexer_int64,
@@ -1238,8 +1230,7 @@ def __new__(cls, data=None,
12381230

12391231
useCache = datetools._will_use_cache(offset)
12401232

1241-
start, end, tz = datetools._figure_out_timezone(start, end,
1242-
tz)
1233+
start, end, tz = datetools._figure_out_timezone(start, end, tz)
12431234

12441235
useCache = useCache and datetools._naive_in_cache_range(start, end)
12451236

@@ -1303,8 +1294,8 @@ def __new__(cls, data=None,
13031294
else:
13041295
subarr = np.array(data, dtype='M8[us]', copy=copy)
13051296

1306-
# TODO: this is horribly inefficient. If user passes data + offset,
1307-
# we need to make sure data points conform. Punting on this
1297+
# TODO: this is horribly inefficient. If user passes data + offset, we
1298+
# need to make sure data points conform. Punting on this
13081299

13091300
if offset is not None:
13101301
for i, ts in enumerate(subarr):
@@ -1423,7 +1414,7 @@ def __setstate__(self, state):
14231414

14241415
@property
14251416
def asi8(self):
1426-
# to do: cache me?
1417+
# do not cache or you'll create a memory leak
14271418
return self.values.view('i8')
14281419

14291420
@property

pandas/core/series.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,8 @@ def reindex(self, index=None, method=None, level=None, fill_value=np.nan,
18901890
fill_value : scalar, default np.NaN
18911891
Value to use for missing values. Defaults to NaN, but can be any
18921892
"compatible" value
1893+
limit : int, default None
1894+
Maximum size gap to forward or backward fill
18931895
18941896
Returns
18951897
-------
@@ -1921,6 +1923,8 @@ def reindex_like(self, other, method=None, limit=None):
19211923
other : Series
19221924
method : string or None
19231925
See Series.reindex docstring
1926+
limit : int, default None
1927+
Maximum size gap to forward or backward fill
19241928
19251929
Notes
19261930
-----
@@ -1968,6 +1972,8 @@ def fillna(self, value=None, method='pad', inplace=False,
19681972
If True, fill the Series in place. Note: this will modify any other
19691973
views on this Series, for example a column in a DataFrame. Returns
19701974
a reference to the filled object, which is self if inplace=True
1975+
limit : int, default None
1976+
Maximum size gap to forward or backward fill
19711977
19721978
See also
19731979
--------

0 commit comments

Comments
 (0)