Skip to content

Commit d776f17

Browse files
Merge pull request #10339 from jorisvandenbossche/versionadded
DOC: add versionadded to docstrings for 0.16.0 / 0.16.1
2 parents 650a538 + 274826e commit d776f17

File tree

8 files changed

+30
-7
lines changed

8 files changed

+30
-7
lines changed

pandas/core/frame.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,9 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
11671167
Format string for datetime objects
11681168
decimal: string, default '.'
11691169
Character recognized as decimal separator. E.g. use ',' for European data
1170+
1171+
.. versionadded:: 0.16.0
1172+
11701173
"""
11711174

11721175
formatter = fmt.CSVFormatter(self, path_or_buf,
@@ -3613,6 +3616,9 @@ def diff(self, periods=1, axis=0):
36133616
periods : int, default 1
36143617
Periods to shift for forming difference
36153618
axis : {0 or 'index', 1 or 'columns'}, default 0
3619+
Take difference over rows (0) or columns (1).
3620+
3621+
.. versionadded: 0.16.1
36163622
36173623
Returns
36183624
-------

pandas/core/generic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,8 @@ def drop(self, labels, axis=0, level=None, inplace=False, errors='raise'):
15781578
errors : {'ignore', 'raise'}, default 'raise'
15791579
If 'ignore', suppress error and existing labels are dropped.
15801580
1581+
.. versionadded:: 0.16.1
1582+
15811583
Returns
15821584
-------
15831585
dropped : type of caller
@@ -1954,6 +1956,8 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
19541956
"""
19551957
Returns a random sample of items from an axis of object.
19561958
1959+
.. versionadded:: 0.16.1
1960+
19571961
Parameters
19581962
----------
19591963
n : int, optional

pandas/core/index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,6 +2788,8 @@ class CategoricalIndex(Index, PandasDelegate):
27882788
Immutable Index implementing an ordered, sliceable set. CategoricalIndex
27892789
represents a sparsely populated Index with an underlying Categorical.
27902790
2791+
.. versionadded:: 0.16.1
2792+
27912793
Parameters
27922794
----------
27932795
data : array-like or Categorical, (1-dimensional)

pandas/core/reshape.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ def get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False,
959959
sparse : bool, default False
960960
Whether the returned DataFrame should be sparse or not.
961961
962+
.. versionadded:: 0.16.1
963+
962964
Returns
963965
-------
964966
dummies : DataFrame

pandas/core/strings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,8 @@ def str_split(arr, pat=None, n=None):
710710
expand : bool, default False
711711
* If True, return DataFrame/MultiIndex expanding dimensionality.
712712
* If False, return Series/Index.
713+
714+
.. versionadded:: 0.16.1
713715
return_type : deprecated, use `expand`
714716
715717
Returns

pandas/sparse/series.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@ def to_coo(self, row_levels=(0,), column_levels=(1,), sort_labels=False):
670670
row_levels and column_levels are the names (labels) or numbers of the levels.
671671
{row_levels, column_levels} must be a partition of the MultiIndex level names (or numbers).
672672
673+
.. versionadded:: 0.16.0
674+
673675
Parameters
674676
----------
675677
row_levels : tuple/list
@@ -719,6 +721,8 @@ def from_coo(cls, A, dense_index=False):
719721
"""
720722
Create a SparseSeries from a scipy.sparse.coo_matrix.
721723
724+
.. versionadded:: 0.16.0
725+
722726
Parameters
723727
----------
724728
A : scipy.sparse.coo_matrix

pandas/tseries/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ def _set_freq(self, value):
13731373
weekday = dayofweek
13741374
dayofyear = _field_accessor('dayofyear', 'doy', "The ordinal day of the year")
13751375
quarter = _field_accessor('quarter', 'q', "The quarter of the date")
1376-
days_in_month = _field_accessor('days_in_month', 'dim', "The number of days in the month")
1376+
days_in_month = _field_accessor('days_in_month', 'dim', "The number of days in the month\n\n.. versionadded:: 0.16.0")
13771377
daysinmonth = days_in_month
13781378
is_month_start = _field_accessor('is_month_start', 'is_month_start', "Logical indicating if first day of month (defined by frequency)")
13791379
is_month_end = _field_accessor('is_month_end', 'is_month_end', "Logical indicating if last day of month (defined by frequency)")

pandas/tseries/offsets.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def wrapper(self, other):
6161
result = func(self, other)
6262
if self._adjust_dst:
6363
result = tslib._localize_pydatetime(result, tz)
64-
64+
6565
result = Timestamp(result)
6666
if self.normalize:
6767
result = result.normalize()
@@ -387,7 +387,7 @@ def freqstr(self):
387387
return fstr
388388

389389
class SingleConstructorOffset(DateOffset):
390-
390+
391391
@classmethod
392392
def _from_name(cls, suffix=None):
393393
# default _from_name calls cls with no args
@@ -538,6 +538,9 @@ def onOffset(self, dt):
538538
class BusinessHour(BusinessMixin, SingleConstructorOffset):
539539
"""
540540
DateOffset subclass representing possibly n business days
541+
542+
.. versionadded: 0.16.1
543+
541544
"""
542545
_prefix = 'BH'
543546
_anchor = 0
@@ -923,7 +926,7 @@ def onOffset(self, dt):
923926

924927
class MonthOffset(SingleConstructorOffset):
925928
_adjust_dst = True
926-
929+
927930
@property
928931
def name(self):
929932
if self.isAnchored:
@@ -1270,9 +1273,9 @@ class WeekOfMonth(DateOffset):
12701273
5: Saturdays
12711274
6: Sundays
12721275
"""
1273-
1276+
12741277
_adjust_dst = True
1275-
1278+
12761279
def __init__(self, n=1, normalize=False, **kwds):
12771280
self.n = n
12781281
self.normalize = normalize
@@ -2210,7 +2213,7 @@ class Easter(DateOffset):
22102213
1583-4099.
22112214
'''
22122215
_adjust_dst = True
2213-
2216+
22142217
def __init__(self, n=1, **kwds):
22152218
super(Easter, self).__init__(n, **kwds)
22162219

0 commit comments

Comments
 (0)