Skip to content

Commit c0933d5

Browse files
committed
DOC: freeze old whatsnew pandas-dev#6856
1 parent 909ec7a commit c0933d5

31 files changed

+491
-545
lines changed

doc/source/whatsnew/v0.10.0.rst

+10-12
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ want to broadcast, we are phasing out this special case (Zen of Python:
4545
*Special cases aren't special enough to break the rules*). Here's what I'm
4646
talking about:
4747

48-
.. ipython:: python
49-
:okwarning:
48+
.. code-block:: python
5049
5150
import pandas as pd
5251
@@ -180,7 +179,7 @@ labeled the aggregated group with the end of the interval: the next day).
180179
DataFrame constructor with no columns specified. The v0.9.0 behavior (names
181180
``X0``, ``X1``, ...) can be reproduced by specifying ``prefix='X'``:
182181

183-
.. ipython:: python
182+
.. code-block:: python
184183
185184
import io
186185
@@ -197,7 +196,7 @@ labeled the aggregated group with the end of the interval: the next day).
197196
though this can be controlled by new ``true_values`` and ``false_values``
198197
arguments:
199198

200-
.. ipython:: python
199+
.. code-block:: python
201200
202201
print(data)
203202
pd.read_csv(io.StringIO(data))
@@ -210,7 +209,7 @@ labeled the aggregated group with the end of the interval: the next day).
210209
- Calling ``fillna`` on Series or DataFrame with no arguments is no longer
211210
valid code. You must either specify a fill value or an interpolation method:
212211

213-
.. ipython:: python
212+
.. code-block:: python
214213
215214
s = pd.Series([np.nan, 1.0, 2.0, np.nan, 4])
216215
s
@@ -219,7 +218,7 @@ labeled the aggregated group with the end of the interval: the next day).
219218
220219
Convenience methods ``ffill`` and ``bfill`` have been added:
221220

222-
.. ipython:: python
221+
.. code-block:: python
223222
224223
s.ffill()
225224
@@ -228,7 +227,7 @@ Convenience methods ``ffill`` and ``bfill`` have been added:
228227
function, that is itself a series, and possibly upcast the result to a
229228
DataFrame
230229

231-
.. ipython:: python
230+
.. code-block:: python
232231
233232
def f(x):
234233
return pd.Series([x, x ** 2], index=["x", "x^2"])
@@ -249,7 +248,7 @@ Convenience methods ``ffill`` and ``bfill`` have been added:
249248
Note: ``set_printoptions``/ ``reset_printoptions`` are now deprecated (but
250249
functioning), the print options now live under "display.XYZ". For example:
251250

252-
.. ipython:: python
251+
.. code-block:: python
253252
254253
pd.get_option("display.max_rows")
255254
@@ -264,7 +263,7 @@ Wide DataFrame printing
264263
Instead of printing the summary information, pandas now splits the string
265264
representation across multiple rows by default:
266265

267-
.. ipython:: python
266+
.. code-block:: python
268267
269268
wide_frame = pd.DataFrame(np.random.randn(5, 16))
270269
@@ -273,14 +272,13 @@ representation across multiple rows by default:
273272
The old behavior of printing out summary information can be achieved via the
274273
'expand_frame_repr' print option:
275274

276-
.. ipython:: python
275+
.. code-block:: python
277276
278277
pd.set_option("expand_frame_repr", False)
279278
280279
wide_frame
281280
282-
.. ipython:: python
283-
:suppress:
281+
.. code-block:: python
284282
285283
pd.reset_option("expand_frame_repr")
286284

doc/source/whatsnew/v0.10.1.rst

+6-9
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ You may need to upgrade your existing data files. Please visit the
3939
**compatibility** section in the main docs.
4040

4141

42-
.. ipython:: python
43-
:suppress:
44-
:okexcept:
42+
.. code-block:: python
4543
4644
import os
4745
@@ -50,7 +48,7 @@ You may need to upgrade your existing data files. Please visit the
5048
You can designate (and index) certain columns that you want to be able to
5149
perform queries on a table, by passing a list to ``data_columns``
5250

53-
.. ipython:: python
51+
.. code-block:: python
5452
5553
store = pd.HDFStore("store.h5")
5654
df = pd.DataFrame(
@@ -82,7 +80,7 @@ Retrieving unique values in an indexable or data column.
8280
8381
You can now store ``datetime64`` in data columns
8482

85-
.. ipython:: python
83+
.. code-block:: python
8684
8785
df_mixed = df.copy()
8886
df_mixed["datetime64"] = pd.Timestamp("20010102")
@@ -97,7 +95,7 @@ You can pass ``columns`` keyword to select to filter a list of the return
9795
columns, this is equivalent to passing a
9896
``Term('columns',list_of_columns_to_filter)``
9997

100-
.. ipython:: python
98+
.. code-block:: python
10199
102100
store.select("df", columns=["A", "B"])
103101
@@ -160,7 +158,7 @@ Multi-table creation via ``append_to_multiple`` and selection via
160158
``select_as_multiple`` can create/select from multiple tables and return a
161159
combined result, by using ``where`` on a selector table.
162160

163-
.. ipython:: python
161+
.. code-block:: python
164162
165163
df_mt = pd.DataFrame(
166164
np.random.randn(8, 6),
@@ -184,8 +182,7 @@ combined result, by using ``where`` on a selector table.
184182
["df1_mt", "df2_mt"], where=["A>0", "B>0"], selector="df1_mt"
185183
)
186184
187-
.. ipython:: python
188-
:suppress:
185+
.. code-block:: python
189186
190187
store.close()
191188
os.remove("store.h5")

doc/source/whatsnew/v0.11.0.rst

+8-9
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Dtypes
7272

7373
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.
7474

75-
.. ipython:: python
75+
.. code-block:: python
7676
7777
df1 = pd.DataFrame(np.random.randn(8, 1), columns=['A'], dtype='float32')
7878
df1
@@ -93,13 +93,13 @@ Dtype conversion
9393

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

96-
.. ipython:: python
96+
.. code-block:: python
9797
9898
df3.values.dtype
9999
100100
Conversion
101101

102-
.. ipython:: python
102+
.. code-block:: python
103103
104104
df3.astype('float32').dtypes
105105
@@ -288,7 +288,7 @@ in addition to the traditional ``NaT``, or not-a-time. This allows convenient na
288288
Furthermore ``datetime64[ns]`` columns are created by default, when passed datetimelike objects (*this change was introduced in 0.10.1*)
289289
(:issue:`2809`, :issue:`2810`)
290290

291-
.. ipython:: python
291+
.. code-block:: python
292292
293293
df = pd.DataFrame(np.random.randn(6, 2), pd.date_range('20010102', periods=6),
294294
columns=['A', ' B'])
@@ -304,7 +304,7 @@ Furthermore ``datetime64[ns]`` columns are created by default, when passed datet
304304
305305
Astype conversion on ``datetime64[ns]`` to ``object``, implicitly converts ``NaT`` to ``np.nan``
306306

307-
.. ipython:: python
307+
.. code-block:: python
308308
309309
import datetime
310310
s = pd.Series([datetime.datetime(2001, 1, 2, 0, 0) for i in range(3)])
@@ -344,13 +344,13 @@ Enhancements
344344

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

347-
.. ipython:: python
347+
.. code-block:: python
348348
349349
df = pd.DataFrame({'A': range(5), 'B': range(5)})
350350
df.to_hdf('store.h5', 'table', append=True)
351351
pd.read_hdf('store.h5', 'table', where=['index > 2'])
352352
353-
.. ipython:: python
353+
.. code-block:: python
354354
:suppress:
355355
:okexcept:
356356
@@ -367,8 +367,7 @@ Enhancements
367367

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

370-
.. ipython:: python
371-
:okwarning:
370+
.. code-block:: python
372371
373372
idx = pd.date_range("2001-10-1", periods=5, freq='M')
374373
ts = pd.Series(np.random.rand(len(idx)), index=idx)

doc/source/whatsnew/v0.12.0.rst

+12-15
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ API changes
4545
``np.nan`` or ``np.inf`` as appropriate (:issue:`3590`). This correct a numpy bug that treats ``integer``
4646
and ``float`` dtypes differently.
4747

48-
.. ipython:: python
48+
.. code-block:: python
4949
5050
p = pd.DataFrame({"first": [4, 5, 8], "second": [0, 0, 3]})
5151
p % 0
@@ -93,7 +93,7 @@ API changes
9393
This case is rarely used, and there are plenty of alternatives. This preserves the
9494
``iloc`` API to be *purely* positional based.
9595

96-
.. ipython:: python
96+
.. code-block:: python
9797
9898
df = pd.DataFrame(range(5), index=list("ABCDE"), columns=["a"])
9999
mask = df.a % 2 == 0
@@ -200,8 +200,7 @@ IO enhancements
200200

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

203-
.. ipython:: python
204-
:okwarning:
203+
.. code-block:: python
205204
206205
df = pd.DataFrame({"a": range(3), "b": list("abc")})
207206
print(df)
@@ -248,7 +247,7 @@ IO enhancements
248247
with ``df.to_csv(..., index=False``), then any ``names`` on the columns index will
249248
be *lost*.
250249

251-
.. ipython:: python
250+
.. code-block:: python
252251
253252
from pandas._testing import makeCustomDataframe as mkdf
254253
@@ -257,8 +256,7 @@ IO enhancements
257256
print(open("mi.csv").read())
258257
pd.read_csv("mi.csv", header=[0, 1, 2, 3], index_col=[0, 1])
259258
260-
.. ipython:: python
261-
:suppress:
259+
.. code-block:: python
262260
263261
import os
264262
@@ -307,7 +305,7 @@ Other enhancements
307305

308306
For example you can do
309307

310-
.. ipython:: python
308+
.. code-block:: python
311309
312310
df = pd.DataFrame({"a": list("ab.."), "b": [1, 2, 3, 4]})
313311
df.replace(regex=r"\s*\.\s*", value=np.nan)
@@ -317,7 +315,7 @@ Other enhancements
317315

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

320-
.. ipython:: python
318+
.. code-block:: python
321319
322320
df.replace(".", np.nan)
323321
@@ -351,7 +349,7 @@ Other enhancements
351349
object. Suppose we want to take only elements that belong to groups with a
352350
group sum greater than 2.
353351

354-
.. ipython:: python
352+
.. code-block:: python
355353
356354
sf = pd.Series([1, 1, 2, 3, 3, 3])
357355
sf.groupby(sf).filter(lambda x: x.sum() > 2)
@@ -362,7 +360,7 @@ Other enhancements
362360
Another useful operation is filtering out elements that belong to groups
363361
with only a couple members.
364362

365-
.. ipython:: python
363+
.. code-block:: python
366364
367365
dff = pd.DataFrame({"A": np.arange(8), "B": list("aabbbbcc")})
368366
dff.groupby("B").filter(lambda x: len(x) > 2)
@@ -371,7 +369,7 @@ Other enhancements
371369
like-indexed objects where the groups that do not pass the filter are
372370
filled with NaNs.
373371

374-
.. ipython:: python
372+
.. code-block:: python
375373
376374
dff.groupby("B").filter(lambda x: len(x) > 2, dropna=False)
377375
@@ -398,7 +396,7 @@ Experimental features
398396
This uses the ``numpy.busdaycalendar`` API introduced in Numpy 1.7 and
399397
therefore requires Numpy 1.7.0 or newer.
400398

401-
.. ipython:: python
399+
.. code-block:: python
402400
403401
from pandas.tseries.offsets import CustomBusinessDay
404402
from datetime import datetime
@@ -433,8 +431,7 @@ Bug fixes
433431
a ``Series`` with either a single character at each index of the original
434432
``Series`` or ``NaN``. For example,
435433

436-
.. ipython:: python
437-
:okwarning:
434+
.. code-block:: python
438435
439436
strs = "go", "bow", "joe", "slow"
440437
ds = pd.Series(strs)

0 commit comments

Comments
 (0)