Skip to content

DOC: freeze old whatsnew #6856 #41442

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

Closed
wants to merge 3 commits into from
Closed
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
22 changes: 10 additions & 12 deletions doc/source/whatsnew/v0.10.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ want to broadcast, we are phasing out this special case (Zen of Python:
*Special cases aren't special enough to break the rules*). Here's what I'm
talking about:

.. ipython:: python
:okwarning:
.. code-block:: python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need to actually paste in the ipython prompts of the execution (e.g. execute the block and paste in the docs)


import pandas as pd

Expand Down Expand Up @@ -180,7 +179,7 @@ labeled the aggregated group with the end of the interval: the next day).
DataFrame constructor with no columns specified. The v0.9.0 behavior (names
``X0``, ``X1``, ...) can be reproduced by specifying ``prefix='X'``:

.. ipython:: python
.. code-block:: python

import io

Expand All @@ -197,7 +196,7 @@ labeled the aggregated group with the end of the interval: the next day).
though this can be controlled by new ``true_values`` and ``false_values``
arguments:

.. ipython:: python
.. code-block:: python

print(data)
pd.read_csv(io.StringIO(data))
Expand All @@ -210,7 +209,7 @@ labeled the aggregated group with the end of the interval: the next day).
- Calling ``fillna`` on Series or DataFrame with no arguments is no longer
valid code. You must either specify a fill value or an interpolation method:

.. ipython:: python
.. code-block:: python

s = pd.Series([np.nan, 1.0, 2.0, np.nan, 4])
s
Expand All @@ -219,7 +218,7 @@ labeled the aggregated group with the end of the interval: the next day).

Convenience methods ``ffill`` and ``bfill`` have been added:

.. ipython:: python
.. code-block:: python

s.ffill()

Expand All @@ -228,7 +227,7 @@ Convenience methods ``ffill`` and ``bfill`` have been added:
function, that is itself a series, and possibly upcast the result to a
DataFrame

.. ipython:: python
.. code-block:: python

def f(x):
return pd.Series([x, x ** 2], index=["x", "x^2"])
Expand All @@ -249,7 +248,7 @@ Convenience methods ``ffill`` and ``bfill`` have been added:
Note: ``set_printoptions``/ ``reset_printoptions`` are now deprecated (but
functioning), the print options now live under "display.XYZ". For example:

.. ipython:: python
.. code-block:: python

pd.get_option("display.max_rows")

Expand All @@ -264,7 +263,7 @@ Wide DataFrame printing
Instead of printing the summary information, pandas now splits the string
representation across multiple rows by default:

.. ipython:: python
.. code-block:: python

wide_frame = pd.DataFrame(np.random.randn(5, 16))

Expand All @@ -273,14 +272,13 @@ representation across multiple rows by default:
The old behavior of printing out summary information can be achieved via the
'expand_frame_repr' print option:

.. ipython:: python
.. code-block:: python

pd.set_option("expand_frame_repr", False)

wide_frame

.. ipython:: python
:suppress:
.. code-block:: python

pd.reset_option("expand_frame_repr")

Expand Down
15 changes: 6 additions & 9 deletions doc/source/whatsnew/v0.10.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ You may need to upgrade your existing data files. Please visit the
**compatibility** section in the main docs.


.. ipython:: python
:suppress:
:okexcept:
.. code-block:: python

import os

Expand All @@ -50,7 +48,7 @@ You may need to upgrade your existing data files. Please visit the
You can designate (and index) certain columns that you want to be able to
perform queries on a table, by passing a list to ``data_columns``

.. ipython:: python
.. code-block:: python

store = pd.HDFStore("store.h5")
df = pd.DataFrame(
Expand Down Expand Up @@ -82,7 +80,7 @@ Retrieving unique values in an indexable or data column.

You can now store ``datetime64`` in data columns

.. ipython:: python
.. code-block:: python

df_mixed = df.copy()
df_mixed["datetime64"] = pd.Timestamp("20010102")
Expand All @@ -97,7 +95,7 @@ You can pass ``columns`` keyword to select to filter a list of the return
columns, this is equivalent to passing a
``Term('columns',list_of_columns_to_filter)``

.. ipython:: python
.. code-block:: python

store.select("df", columns=["A", "B"])

Expand Down Expand Up @@ -160,7 +158,7 @@ Multi-table creation via ``append_to_multiple`` and selection via
``select_as_multiple`` can create/select from multiple tables and return a
combined result, by using ``where`` on a selector table.

.. ipython:: python
.. code-block:: python

df_mt = pd.DataFrame(
np.random.randn(8, 6),
Expand All @@ -184,8 +182,7 @@ combined result, by using ``where`` on a selector table.
["df1_mt", "df2_mt"], where=["A>0", "B>0"], selector="df1_mt"
)

.. ipython:: python
:suppress:
.. code-block:: python

store.close()
os.remove("store.h5")
Expand Down
19 changes: 8 additions & 11 deletions doc/source/whatsnew/v0.11.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Dtypes

Numeric dtypes will propagate and can coexist in DataFrames. If a dtype is passed (either directly via the ``dtype`` keyword, a passed ``ndarray``, or a passed ``Series``, then it will be preserved in DataFrame operations. Furthermore, different numeric dtypes will **NOT** be combined. The following example will give you a taste.

.. ipython:: python
.. code-block:: python

df1 = pd.DataFrame(np.random.randn(8, 1), columns=['A'], dtype='float32')
df1
Expand All @@ -93,13 +93,13 @@ Dtype conversion

This is lower-common-denominator upcasting, meaning you get the dtype which can accommodate all of the types

.. ipython:: python
.. code-block:: python

df3.values.dtype

Conversion

.. ipython:: python
.. code-block:: python

df3.astype('float32').dtypes

Expand Down Expand Up @@ -288,7 +288,7 @@ in addition to the traditional ``NaT``, or not-a-time. This allows convenient na
Furthermore ``datetime64[ns]`` columns are created by default, when passed datetimelike objects (*this change was introduced in 0.10.1*)
(:issue:`2809`, :issue:`2810`)

.. ipython:: python
.. code-block:: python

df = pd.DataFrame(np.random.randn(6, 2), pd.date_range('20010102', periods=6),
columns=['A', ' B'])
Expand All @@ -304,7 +304,7 @@ Furthermore ``datetime64[ns]`` columns are created by default, when passed datet

Astype conversion on ``datetime64[ns]`` to ``object``, implicitly converts ``NaT`` to ``np.nan``

.. ipython:: python
.. code-block:: python

import datetime
s = pd.Series([datetime.datetime(2001, 1, 2, 0, 0) for i in range(3)])
Expand Down Expand Up @@ -344,15 +344,13 @@ Enhancements

- support ``read_hdf/to_hdf`` API similar to ``read_csv/to_csv``

.. ipython:: python
.. code-block:: python

df = pd.DataFrame({'A': range(5), 'B': range(5)})
df.to_hdf('store.h5', 'table', append=True)
pd.read_hdf('store.h5', 'table', where=['index > 2'])

.. ipython:: python
:suppress:
:okexcept:
.. code-block:: python

import os

Expand All @@ -367,8 +365,7 @@ Enhancements

- You can now select with a string from a DataFrame with a datelike index, in a similar way to a Series (:issue:`3070`)

.. ipython:: python
:okwarning:
.. code-block:: python

idx = pd.date_range("2001-10-1", periods=5, freq='M')
ts = pd.Series(np.random.rand(len(idx)), index=idx)
Expand Down
27 changes: 12 additions & 15 deletions doc/source/whatsnew/v0.12.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ API changes
``np.nan`` or ``np.inf`` as appropriate (:issue:`3590`). This correct a numpy bug that treats ``integer``
and ``float`` dtypes differently.

.. ipython:: python
.. code-block:: python

p = pd.DataFrame({"first": [4, 5, 8], "second": [0, 0, 3]})
p % 0
Expand Down Expand Up @@ -93,7 +93,7 @@ API changes
This case is rarely used, and there are plenty of alternatives. This preserves the
``iloc`` API to be *purely* positional based.

.. ipython:: python
.. code-block:: python

df = pd.DataFrame(range(5), index=list("ABCDE"), columns=["a"])
mask = df.a % 2 == 0
Expand Down Expand Up @@ -200,8 +200,7 @@ IO enhancements

You can use ``pd.read_html()`` to read the output from ``DataFrame.to_html()`` like so

.. ipython:: python
:okwarning:
.. code-block:: python

df = pd.DataFrame({"a": range(3), "b": list("abc")})
print(df)
Expand Down Expand Up @@ -248,7 +247,7 @@ IO enhancements
with ``df.to_csv(..., index=False``), then any ``names`` on the columns index will
be *lost*.

.. ipython:: python
.. code-block:: python

from pandas._testing import makeCustomDataframe as mkdf

Expand All @@ -257,8 +256,7 @@ IO enhancements
print(open("mi.csv").read())
pd.read_csv("mi.csv", header=[0, 1, 2, 3], index_col=[0, 1])

.. ipython:: python
:suppress:
.. code-block:: python

import os

Expand Down Expand Up @@ -307,7 +305,7 @@ Other enhancements

For example you can do

.. ipython:: python
.. code-block:: python

df = pd.DataFrame({"a": list("ab.."), "b": [1, 2, 3, 4]})
df.replace(regex=r"\s*\.\s*", value=np.nan)
Expand All @@ -317,7 +315,7 @@ Other enhancements

Regular string replacement still works as expected. For example, you can do

.. ipython:: python
.. code-block:: python

df.replace(".", np.nan)

Expand Down Expand Up @@ -351,7 +349,7 @@ Other enhancements
object. Suppose we want to take only elements that belong to groups with a
group sum greater than 2.

.. ipython:: python
.. code-block:: python

sf = pd.Series([1, 1, 2, 3, 3, 3])
sf.groupby(sf).filter(lambda x: x.sum() > 2)
Expand All @@ -362,7 +360,7 @@ Other enhancements
Another useful operation is filtering out elements that belong to groups
with only a couple members.

.. ipython:: python
.. code-block:: python

dff = pd.DataFrame({"A": np.arange(8), "B": list("aabbbbcc")})
dff.groupby("B").filter(lambda x: len(x) > 2)
Expand All @@ -371,7 +369,7 @@ Other enhancements
like-indexed objects where the groups that do not pass the filter are
filled with NaNs.

.. ipython:: python
.. code-block:: python

dff.groupby("B").filter(lambda x: len(x) > 2, dropna=False)

Expand All @@ -398,7 +396,7 @@ Experimental features
This uses the ``numpy.busdaycalendar`` API introduced in Numpy 1.7 and
therefore requires Numpy 1.7.0 or newer.

.. ipython:: python
.. code-block:: python

from pandas.tseries.offsets import CustomBusinessDay
from datetime import datetime
Expand Down Expand Up @@ -433,8 +431,7 @@ Bug fixes
a ``Series`` with either a single character at each index of the original
``Series`` or ``NaN``. For example,

.. ipython:: python
:okwarning:
.. code-block:: python

strs = "go", "bow", "joe", "slow"
ds = pd.Series(strs)
Expand Down
Loading