Skip to content

Commit

Permalink
More warnings (pandas-dev#21808)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger authored and victor committed Sep 30, 2018
1 parent ca4ec32 commit 2ff10af
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
6 changes: 3 additions & 3 deletions doc/source/merging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ need to be:

.. ipython:: python
result = df1.append(df4)
result = df1.append(df4, sort=False)
.. ipython:: python
:suppress:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
30 changes: 18 additions & 12 deletions doc/source/whatsnew/v0.24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2ff10af

Please sign in to comment.