Skip to content

DOC: add versionadded to docstrings for 0.16.0 / 0.16.1 #10339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,9 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
Format string for datetime objects
decimal: string, default '.'
Character recognized as decimal separator. E.g. use ',' for European data

.. versionadded:: 0.16.0

"""

formatter = fmt.CSVFormatter(self, path_or_buf,
Expand Down Expand Up @@ -3613,6 +3616,9 @@ def diff(self, periods=1, axis=0):
periods : int, default 1
Periods to shift for forming difference
axis : {0 or 'index', 1 or 'columns'}, default 0
Take difference over rows (0) or columns (1).

.. versionadded: 0.16.1

Returns
-------
Expand Down
4 changes: 4 additions & 0 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,8 @@ def drop(self, labels, axis=0, level=None, inplace=False, errors='raise'):
errors : {'ignore', 'raise'}, default 'raise'
If 'ignore', suppress error and existing labels are dropped.

.. versionadded:: 0.16.1

Returns
-------
dropped : type of caller
Expand Down Expand Up @@ -1953,6 +1955,8 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
"""
Returns a random sample of items from an axis of object.

.. versionadded:: 0.16.1

Parameters
----------
n : int, optional
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,8 @@ class CategoricalIndex(Index, PandasDelegate):
Immutable Index implementing an ordered, sliceable set. CategoricalIndex
represents a sparsely populated Index with an underlying Categorical.

.. versionadded:: 0.16.1

Parameters
----------
data : array-like or Categorical, (1-dimensional)
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,8 @@ def get_dummies(data, prefix=None, prefix_sep='_', dummy_na=False,
sparse : bool, default False
Whether the returned DataFrame should be sparse or not.

.. versionadded:: 0.16.1

Returns
-------
dummies : DataFrame
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ def str_split(arr, pat=None, n=None):
expand : bool, default False
* If True, return DataFrame/MultiIndex expanding dimensionality.
* If False, return Series/Index.

.. versionadded:: 0.16.1
return_type : deprecated, use `expand`

Returns
Expand Down
4 changes: 4 additions & 0 deletions pandas/sparse/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@ def to_coo(self, row_levels=(0,), column_levels=(1,), sort_labels=False):
row_levels and column_levels are the names (labels) or numbers of the levels.
{row_levels, column_levels} must be a partition of the MultiIndex level names (or numbers).

.. versionadded:: 0.16.0

Parameters
----------
row_levels : tuple/list
Expand Down Expand Up @@ -716,6 +718,8 @@ def from_coo(cls, A, dense_index=False):
"""
Create a SparseSeries from a scipy.sparse.coo_matrix.

.. versionadded:: 0.16.0

Parameters
----------
A : scipy.sparse.coo_matrix
Expand Down
2 changes: 1 addition & 1 deletion pandas/tseries/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def _set_freq(self, value):
weekday = dayofweek
dayofyear = _field_accessor('dayofyear', 'doy', "The ordinal day of the year")
quarter = _field_accessor('quarter', 'q', "The quarter of the date")
days_in_month = _field_accessor('days_in_month', 'dim', "The number of days in the month")
days_in_month = _field_accessor('days_in_month', 'dim', "The number of days in the month\n\n.. versionadded:: 0.16.0")
daysinmonth = days_in_month
is_month_start = _field_accessor('is_month_start', 'is_month_start', "Logical indicating if first day of month (defined by frequency)")
is_month_end = _field_accessor('is_month_end', 'is_month_end', "Logical indicating if last day of month (defined by frequency)")
Expand Down
15 changes: 9 additions & 6 deletions pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def wrapper(self, other):
result = func(self, other)
if self._adjust_dst:
result = tslib._localize_pydatetime(result, tz)

result = Timestamp(result)
if self.normalize:
result = result.normalize()
Expand Down Expand Up @@ -387,7 +387,7 @@ def freqstr(self):
return fstr

class SingleConstructorOffset(DateOffset):

@classmethod
def _from_name(cls, suffix=None):
# default _from_name calls cls with no args
Expand Down Expand Up @@ -538,6 +538,9 @@ def onOffset(self, dt):
class BusinessHour(BusinessMixin, SingleConstructorOffset):
"""
DateOffset subclass representing possibly n business days

.. versionadded: 0.16.1

"""
_prefix = 'BH'
_anchor = 0
Expand Down Expand Up @@ -923,7 +926,7 @@ def onOffset(self, dt):

class MonthOffset(SingleConstructorOffset):
_adjust_dst = True

@property
def name(self):
if self.isAnchored:
Expand Down Expand Up @@ -1270,9 +1273,9 @@ class WeekOfMonth(DateOffset):
5: Saturdays
6: Sundays
"""

_adjust_dst = True

def __init__(self, n=1, normalize=False, **kwds):
self.n = n
self.normalize = normalize
Expand Down Expand Up @@ -2210,7 +2213,7 @@ class Easter(DateOffset):
1583-4099.
'''
_adjust_dst = True

def __init__(self, n=1, **kwds):
super(Easter, self).__init__(n, **kwds)

Expand Down