diff --git a/pandas/core/frame.py b/pandas/core/frame.py index ed01323eb9a27..2411fde2d07af 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -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, @@ -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 ------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b747f0a2ceacb..7012654b43d2b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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 @@ -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 diff --git a/pandas/core/index.py b/pandas/core/index.py index de30fee4009f4..4a7031fefd794 100644 --- a/pandas/core/index.py +++ b/pandas/core/index.py @@ -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) diff --git a/pandas/core/reshape.py b/pandas/core/reshape.py index 3225b4aa33ac2..fd786fa30f842 100644 --- a/pandas/core/reshape.py +++ b/pandas/core/reshape.py @@ -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 diff --git a/pandas/core/strings.py b/pandas/core/strings.py index f4ac0166cf44b..7f0ed79f638bd 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -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 diff --git a/pandas/sparse/series.py b/pandas/sparse/series.py index 2c328e51b5090..14a97a01f1d0a 100644 --- a/pandas/sparse/series.py +++ b/pandas/sparse/series.py @@ -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 @@ -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 diff --git a/pandas/tseries/index.py b/pandas/tseries/index.py index bd0869b9525b7..d3a4917a7ea66 100644 --- a/pandas/tseries/index.py +++ b/pandas/tseries/index.py @@ -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)") diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 67e27bbffbf73..3bebd0daa6d29 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -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() @@ -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 @@ -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 @@ -923,7 +926,7 @@ def onOffset(self, dt): class MonthOffset(SingleConstructorOffset): _adjust_dst = True - + @property def name(self): if self.isAnchored: @@ -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 @@ -2210,7 +2213,7 @@ class Easter(DateOffset): 1583-4099. ''' _adjust_dst = True - + def __init__(self, n=1, **kwds): super(Easter, self).__init__(n, **kwds)