diff --git a/doc/source/merging.rst b/doc/source/merging.rst index 2eb5962ead986..eb71722dd563a 100644 --- a/doc/source/merging.rst +++ b/doc/source/merging.rst @@ -494,7 +494,7 @@ You can also pass a list of dicts or Series: dicts = [{'A': 1, 'B': 2, 'C': 3, 'X': 4}, {'A': 5, 'B': 6, 'C': 7, 'Y': 8}] - result = df1.append(dicts, ignore_index=True) + result = df1.append(dicts, ignore_index=True, sort=False) .. ipython:: python :suppress: diff --git a/doc/source/text.rst b/doc/source/text.rst index 34bb1a07dfc08..dde82e3c19f82 100644 --- a/doc/source/text.rst +++ b/doc/source/text.rst @@ -270,12 +270,13 @@ For concatenation with a ``Series`` or ``DataFrame``, it is possible to align th the ``join``-keyword. .. ipython:: python + :okwarning: - u = pd.Series(['b', 'd', 'a', 'c'], index=[1, 3, 0, 2]) - s - u - s.str.cat(u) - s.str.cat(u, join='left') + u = pd.Series(['b', 'd', 'a', 'c'], index=[1, 3, 0, 2]) + s + u + s.str.cat(u) + s.str.cat(u, join='left') .. warning:: @@ -296,7 +297,7 @@ In particular, alignment also means that the different lengths do not need to co The same alignment can be used when ``others`` is a ``DataFrame``: .. ipython:: python - + f = d.loc[[3, 2, 1, 0], :] s f @@ -311,7 +312,7 @@ All one-dimensional list-likes can be arbitrarily combined in a list-like contai s u - s.str.cat([u, pd.Index(u.values), ['A', 'B', 'C', 'D'], map(str, u.index)], na_rep='-') + s.str.cat([u, u.values, ['A', 'B', 'C', 'D'], map(str, u.index)], na_rep='-') All elements must match in length to the calling ``Series`` (or ``Index``), except those having an index if ``join`` is not None: diff --git a/doc/source/whatsnew/v0.10.0.txt b/doc/source/whatsnew/v0.10.0.txt index ec4ac17c80fd7..298088a4f96b3 100644 --- a/doc/source/whatsnew/v0.10.0.txt +++ b/doc/source/whatsnew/v0.10.0.txt @@ -281,17 +281,12 @@ The old behavior of printing out summary information can be achieved via the The width of each line can be changed via 'line_width' (80 by default): -.. ipython:: python +.. code-block:: python pd.set_option('line_width', 40) wide_frame -.. ipython:: python - :suppress: - - pd.reset_option('line_width') - Updated PyTables Support ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/whatsnew/v0.13.1.txt b/doc/source/whatsnew/v0.13.1.txt index 51ca6116d42ce..a4807a6d61b76 100644 --- a/doc/source/whatsnew/v0.13.1.txt +++ b/doc/source/whatsnew/v0.13.1.txt @@ -119,8 +119,7 @@ API changes equal. NaNs in identical locations are treated as equal. (:issue:`5283`) See also :ref:`the docs` for a motivating example. - .. ipython:: python - :okwarning: + .. code-block:: python df = DataFrame({'col':['foo', 0, np.nan]}) df2 = DataFrame({'col':[np.nan, 0, 'foo']}, index=[2,1,0]) diff --git a/doc/source/whatsnew/v0.14.1.txt b/doc/source/whatsnew/v0.14.1.txt index 5183dd24e9b34..d019cf54086c6 100644 --- a/doc/source/whatsnew/v0.14.1.txt +++ b/doc/source/whatsnew/v0.14.1.txt @@ -92,15 +92,15 @@ Enhancements ``offsets.apply``, ``rollforward`` and ``rollback`` resets the time (hour, minute, etc) or not (default ``False``, preserves time) (:issue:`7156`): - .. ipython:: python + .. code-block:: python - import pandas.tseries.offsets as offsets + import pandas.tseries.offsets as offsets - day = offsets.Day() - day.apply(Timestamp('2014-01-01 09:00')) + day = offsets.Day() + day.apply(Timestamp('2014-01-01 09:00')) - day = offsets.Day(normalize=True) - day.apply(Timestamp('2014-01-01 09:00')) + day = offsets.Day(normalize=True) + day.apply(Timestamp('2014-01-01 09:00')) - ``PeriodIndex`` is represented as the same format as ``DatetimeIndex`` (:issue:`7601`) - ``StringMethods`` now work on empty Series (:issue:`7242`) diff --git a/doc/source/whatsnew/v0.15.0.txt b/doc/source/whatsnew/v0.15.0.txt index 79003296ac165..4be6975958af5 100644 --- a/doc/source/whatsnew/v0.15.0.txt +++ b/doc/source/whatsnew/v0.15.0.txt @@ -1008,7 +1008,7 @@ Other: business_dates = date_range(start='4/1/2014', end='6/30/2014', freq='B') df = DataFrame(1, index=business_dates, columns=['a', 'b']) # get the first, 4th, and last date index for each month - df.groupby((df.index.year, df.index.month)).nth([0, 3, -1]) + df.groupby([df.index.year, df.index.month]).nth([0, 3, -1]) - ``Period`` and ``PeriodIndex`` supports addition/subtraction with ``timedelta``-likes (:issue:`7966`) diff --git a/doc/source/whatsnew/v0.17.1.txt b/doc/source/whatsnew/v0.17.1.txt index c5ae0d147824c..328a8193c8b13 100644 --- a/doc/source/whatsnew/v0.17.1.txt +++ b/doc/source/whatsnew/v0.17.1.txt @@ -58,7 +58,7 @@ We can render the HTML to get the following table. :file: whatsnew_0171_html_table.html :class:`~pandas.core.style.Styler` interacts nicely with the Jupyter Notebook. -See the :doc:`documentation