Skip to content

Commit d243f3c

Browse files
committed
add back some kwargs usage, closes GH8883
1 parent 38021ca commit d243f3c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pandas/core/generic.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ def tail(self, n=5):
19321932
#----------------------------------------------------------------------
19331933
# Attribute access
19341934

1935-
def __finalize__(self, other, method=None):
1935+
def __finalize__(self, other, method=None, **kwargs):
19361936
"""
19371937
propagate metadata from other to self
19381938
@@ -3404,7 +3404,7 @@ def mask(self, cond):
34043404
"""
34053405
return self.where(~cond, np.nan)
34063406

3407-
def shift(self, periods=1, freq=None, axis=0, **kwds):
3407+
def shift(self, periods=1, freq=None, axis=0, **kwargs):
34083408
"""
34093409
Shift index by desired number of periods with an optional time freq
34103410
@@ -3430,10 +3430,10 @@ def shift(self, periods=1, freq=None, axis=0, **kwds):
34303430
return self
34313431

34323432
block_axis = self._get_block_manager_axis(axis)
3433-
if freq is None and not len(kwds):
3433+
if freq is None and not len(kwargs):
34343434
new_data = self._data.shift(periods=periods, axis=block_axis)
34353435
else:
3436-
return self.tshift(periods, freq, **kwds)
3436+
return self.tshift(periods, freq, **kwargs)
34373437

34383438
return self._constructor(new_data).__finalize__(self)
34393439

@@ -3473,7 +3473,7 @@ def slice_shift(self, periods=1, axis=0):
34733473

34743474
return new_obj.__finalize__(self)
34753475

3476-
def tshift(self, periods=1, freq=None, axis=0, **kwds):
3476+
def tshift(self, periods=1, freq=None, axis=0, **kwargs):
34773477
"""
34783478
Shift the time index, using the index's frequency if available
34793479
@@ -3512,7 +3512,7 @@ def tshift(self, periods=1, freq=None, axis=0, **kwds):
35123512
if periods == 0:
35133513
return self
35143514

3515-
offset = _resolve_offset(freq, kwds)
3515+
offset = _resolve_offset(freq, kwargs)
35163516

35173517
if isinstance(offset, string_types):
35183518
offset = datetools.to_offset(offset)
@@ -3894,28 +3894,28 @@ def describe_1d(data, percentiles):
38943894

38953895
@Appender(_shared_docs['pct_change'] % _shared_doc_kwargs)
38963896
def pct_change(self, periods=1, fill_method='pad', limit=None, freq=None,
3897-
**kwds):
3897+
**kwargs):
38983898
# TODO: Not sure if above is correct - need someone to confirm.
3899-
axis = self._get_axis_number(kwds.pop('axis', self._stat_axis_name))
3899+
axis = self._get_axis_number(kwargs.pop('axis', self._stat_axis_name))
39003900
if fill_method is None:
39013901
data = self
39023902
else:
39033903
data = self.fillna(method=fill_method, limit=limit)
39043904

39053905
rs = (data.div(data.shift(periods=periods, freq=freq,
3906-
axis=axis, **kwds)) - 1)
3906+
axis=axis, **kwargs)) - 1)
39073907
if freq is None:
39083908
mask = com.isnull(_values_from_object(self))
39093909
np.putmask(rs.values, mask, np.nan)
39103910
return rs
39113911

3912-
def _agg_by_level(self, name, axis=0, level=0, skipna=True, **kwds):
3912+
def _agg_by_level(self, name, axis=0, level=0, skipna=True, **kwargs):
39133913
grouped = self.groupby(level=level, axis=axis)
39143914
if hasattr(grouped, name) and skipna:
3915-
return getattr(grouped, name)(**kwds)
3915+
return getattr(grouped, name)(**kwargs)
39163916
axis = self._get_axis_number(axis)
39173917
method = getattr(type(self), name)
3918-
applyf = lambda x: method(x, axis=axis, skipna=skipna, **kwds)
3918+
applyf = lambda x: method(x, axis=axis, skipna=skipna, **kwargs)
39193919
return grouped.aggregate(applyf)
39203920

39213921
@classmethod

pandas/core/index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def __unicode__(self):
415415
quote_strings=True)
416416
return "%s(%s, dtype='%s')" % (type(self).__name__, prepr, self.dtype)
417417

418-
def to_series(self):
418+
def to_series(self, **kwargs):
419419
"""
420420
Create a Series with both index and values equal to the index keys
421421
useful with map for returning an indexer based on an index

0 commit comments

Comments
 (0)