From 0446dba3c4d1e58da069c42d2403eb1793594dcc Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Sat, 7 Jul 2018 21:32:55 -0500 Subject: [PATCH] More warnings --- doc/source/merging.rst | 6 +++--- doc/source/whatsnew/v0.24.0.txt | 30 ++++++++++++++++++------------ pandas/core/strings.py | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/doc/source/merging.rst b/doc/source/merging.rst index eb71722dd563a..d78e476dd7837 100644 --- a/doc/source/merging.rst +++ b/doc/source/merging.rst @@ -245,7 +245,7 @@ need to be: .. ipython:: python - result = df1.append(df4) + result = df1.append(df4, sort=False) .. ipython:: python :suppress: @@ -285,7 +285,7 @@ do this, use the ``ignore_index`` argument: .. ipython:: python - result = pd.concat([df1, df4], ignore_index=True) + result = pd.concat([df1, df4], ignore_index=True, sort=False) .. ipython:: python :suppress: @@ -299,7 +299,7 @@ This is also a valid argument to :meth:`DataFrame.append`: .. ipython:: python - result = df1.append(df4, ignore_index=True) + result = df1.append(df4, ignore_index=True, sort=False) .. ipython:: python :suppress: diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index 1c3d80bdc3abd..812ea366b704a 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -100,27 +100,33 @@ Creating a ``Tick`` object (:class:`Day`, :class:`Hour`, :class:`Minute`, `normalize=True` is no longer supported. This prevents unexpected behavior where addition could fail to be monotone or associative. (:issue:`21427`) -.. ipython:: python +*Previous Behavior*: - ts = pd.Timestamp('2018-06-11 18:01:14') - ts - tic = pd.offsets.Hour(n=2, normalize=True) - tic +.. code-block:: ipython -Previous Behavior: -.. code-block:: ipython + In [2]: ts = pd.Timestamp('2018-06-11 18:01:14') - In [4]: ts + tic - Out [4]: Timestamp('2018-06-11 00:00:00') + In [3]: ts + Out[3]: Timestamp('2018-06-11 18:01:14') - In [5]: ts + tic + tic + tic == ts + (tic + tic + tic) - Out [5]: False + In [4]: tic = pd.offsets.Hour(n=2, normalize=True) + ...: -Current Behavior: + In [5]: tic + Out[5]: <2 * Hours> + + In [6]: ts + tic + Out[6]: Timestamp('2018-06-11 00:00:00') + + In [7]: ts + tic + tic + tic == ts + (tic + tic + tic) + Out[7]: False + +*Current Behavior*: .. ipython:: python + ts = pd.Timestamp('2018-06-11 18:01:14') tic = pd.offsets.Hour(n=2) ts + tic + tic + tic == ts + (tic + tic + tic) diff --git a/pandas/core/strings.py b/pandas/core/strings.py index e422027b9b500..669b19fc35430 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -2556,7 +2556,7 @@ def encode(self, encoding, errors="strict"): result = str_encode(self._data, encoding, errors) return self._wrap_result(result) - _shared_docs['str_strip'] = (""" + _shared_docs['str_strip'] = (r""" Remove leading and trailing characters. Strip whitespaces (including newlines) or a set of specified characters