Skip to content

Commit 6600b5b

Browse files
TomAugspurgerjreback
authored andcommitted
DOC: whatsnew updates (#30795)
1 parent bde2527 commit 6600b5b

File tree

2 files changed

+92
-85
lines changed

2 files changed

+92
-85
lines changed

doc/source/user_guide/io.rst

+2
Original file line numberDiff line numberDiff line change
@@ -3877,6 +3877,8 @@ specified in the format: ``<float>(<unit>)``, where float may be signed (and fra
38773877
store.append('dftd', dftd, data_columns=True)
38783878
store.select('dftd', "C<'-3.5D'")
38793879
3880+
.. _io.query_multi:
3881+
38803882
Query MultiIndex
38813883
++++++++++++++++
38823884

doc/source/whatsnew/v1.0.0.rst

+90-85
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,18 @@
33
What's new in 1.0.0 (??)
44
------------------------
55

6-
.. warning::
7-
8-
Starting with the 1.x series of releases, pandas only supports Python 3.6.1 and higher.
6+
These are the changes in pandas 1.0.0. See :ref:`release` for a full changelog
7+
including other versions of pandas.
98

109
New Deprecation Policy
1110
~~~~~~~~~~~~~~~~~~~~~~
1211

13-
Starting with Pandas 1.0.0, pandas will adopt a version of `SemVer`_.
14-
15-
Historically, pandas has used a "rolling" deprecation policy, with occasional
16-
outright breaking API changes. Where possible, we would deprecate the behavior
17-
we'd like to change, giving an option to adopt the new behavior (via a keyword
18-
or an alternative method), and issuing a warning for users of the old behavior.
19-
Sometimes, a deprecation was not possible, and we would make an outright API
20-
breaking change.
21-
22-
We'll continue to *introduce* deprecations in major and minor releases (e.g.
23-
1.0.0, 1.1.0, ...). Those deprecations will be *enforced* in the next major
24-
release.
25-
26-
Note that *behavior changes* and *API breaking changes* are not identical. API
27-
breaking changes will only be released in major versions. If we consider a
28-
behavior to be a bug, and fixing that bug induces a behavior change, we'll
29-
release that change in a minor release. This is a sometimes difficult judgment
30-
call that we'll do our best on.
12+
Starting with Pandas 1.0.0, pandas will adopt a variant of `SemVer`_ to
13+
version releases. Briefly,
3114

32-
This doesn't mean that pandas' pace of development will slow down. In the `2019
33-
Pandas User Survey`_, about 95% of the respondents said they considered pandas
34-
"stable enough". This indicates there's an appetite for new features, even if it
35-
comes at the cost of break API. The difference is that now API breaking changes
36-
will be accompanied with a bump in the major version number (e.g. pandas 1.5.1
37-
-> 2.0.0).
15+
* Deprecations will be introduced in minor releases (e.g. 1.1.0, 1.2.0, 2.1.0, ...)
16+
* Deprecations will be enforced in major releases (e.g. 1.0.0, 2.0,0, 3.0.0, ...)
17+
* API-breaking changes will be made only in major releases
3818

3919
See :ref:`policies.version` for more.
4020

@@ -43,13 +23,56 @@ See :ref:`policies.version` for more.
4323

4424
{{ header }}
4525

46-
These are the changes in pandas 1.0.0. See :ref:`release` for a full changelog
47-
including other versions of pandas.
48-
26+
.. ---------------------------------------------------------------------------
4927
5028
Enhancements
5129
~~~~~~~~~~~~
5230

31+
.. _whatsnew_100.NA:
32+
33+
Experimental ``NA`` scalar to denote missing values
34+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35+
36+
A new ``pd.NA`` value (singleton) is introduced to represent scalar missing
37+
values. Up to now, pandas used several values to represent missing data: ``np.nan`` is used for this for float data, ``np.nan`` or
38+
``None`` for object-dtype data and ``pd.NaT`` for datetime-like data. The
39+
goal of ``pd.NA`` is to provide a "missing" indicator that can be used
40+
consistently across data types. ``pd.NA`` is currently used by the nullable integer and boolean
41+
data types and the new string data type (:issue:`28095`).
42+
43+
.. warning::
44+
45+
Experimental: the behaviour of ``pd.NA`` can still change without warning.
46+
47+
For example, creating a Series using the nullable integer dtype:
48+
49+
.. ipython:: python
50+
51+
s = pd.Series([1, 2, None], dtype="Int64")
52+
s
53+
s[2]
54+
55+
Compared to ``np.nan``, ``pd.NA`` behaves differently in certain operations.
56+
In addition to arithmetic operations, ``pd.NA`` also propagates as "missing"
57+
or "unknown" in comparison operations:
58+
59+
.. ipython:: python
60+
61+
np.nan > 1
62+
pd.NA > 1
63+
64+
For logical operations, ``pd.NA`` follows the rules of the
65+
`three-valued logic <https://en.wikipedia.org/wiki/Three-valued_logic>`__ (or
66+
*Kleene logic*). For example:
67+
68+
.. ipython:: python
69+
70+
pd.NA | True
71+
72+
For more, see :ref:`NA section <missing_data.NA>` in the user guide on missing
73+
data.
74+
75+
5376
.. _whatsnew_100.string:
5477

5578
Dedicated string data type
@@ -102,59 +125,15 @@ String accessor methods returning integers will return a value with :class:`Int6
102125
We recommend explicitly using the ``string`` data type when working with strings.
103126
See :ref:`text.types` for more.
104127

105-
.. _whatsnew_100.NA:
106-
107-
Experimental ``NA`` scalar to denote missing values
108-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109-
110-
A new ``pd.NA`` value (singleton) is introduced to represent scalar missing
111-
values. Up to now, ``np.nan`` is used for this for float data, ``np.nan`` or
112-
``None`` for object-dtype data and ``pd.NaT`` for datetime-like data. The
113-
goal of ``pd.NA`` is provide a "missing" indicator that can be used
114-
consistently across data types. For now, the nullable integer and boolean
115-
data types and the new string data type make use of ``pd.NA`` (:issue:`28095`).
116-
117-
.. warning::
118-
119-
Experimental: the behaviour of ``pd.NA`` can still change without warning.
120-
121-
For example, creating a Series using the nullable integer dtype:
122-
123-
.. ipython:: python
124-
125-
s = pd.Series([1, 2, None], dtype="Int64")
126-
s
127-
s[2]
128-
129-
Compared to ``np.nan``, ``pd.NA`` behaves differently in certain operations.
130-
In addition to arithmetic operations, ``pd.NA`` also propagates as "missing"
131-
or "unknown" in comparison operations:
132-
133-
.. ipython:: python
134-
135-
np.nan > 1
136-
pd.NA > 1
137-
138-
For logical operations, ``pd.NA`` follows the rules of the
139-
`three-valued logic <https://en.wikipedia.org/wiki/Three-valued_logic>`__ (or
140-
*Kleene logic*). For example:
141-
142-
.. ipython:: python
143-
144-
pd.NA | True
145-
146-
For more, see :ref:`NA section <missing_data.NA>` in the user guide on missing
147-
data.
148-
149128
.. _whatsnew_100.boolean:
150129

151130
Boolean data type with missing values support
152131
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
153132

154133
We've added :class:`BooleanDtype` / :class:`~arrays.BooleanArray`, an extension
155-
type dedicated to boolean data that can hold missing values. With the default
156-
``'bool`` data type based on a numpy bool array, the column can only hold
157-
True or False values and not missing values. This new :class:`BooleanDtype`
134+
type dedicated to boolean data that can hold missing values. The default
135+
``bool`` data type based on a bool-dtype NumPy array, the column can only hold
136+
``True`` or ``False``, and not missing values. This new :class:`~arrays.BooleanArray`
158137
can store missing values as well by keeping track of this in a separate mask.
159138
(:issue:`29555`, :issue:`30095`)
160139

@@ -191,6 +170,18 @@ method on a :func:`pandas.api.indexers.BaseIndexer` subclass that will generate
191170
indices used for each window during the rolling aggregation. For more details and example usage, see
192171
the :ref:`custom window rolling documentation <stats.custom_rolling_window>`
193172

173+
.. _whatsnew_1000.to_markdown:
174+
175+
Converting to Markdown
176+
^^^^^^^^^^^^^^^^^^^^^^
177+
178+
We've added :meth:`~DataFrame.to_markdown` for creating a markdown table (:issue:`11052`)
179+
180+
.. ipython:: python
181+
182+
df = pd.DataFrame({"A": [1, 2, 3], "B": [1, 2, 3]}, index=['a', 'a', 'b'])
183+
print(df.to_markdown())
184+
194185
.. _whatsnew_1000.enhancements.other:
195186

196187
Other enhancements
@@ -222,7 +213,6 @@ Other enhancements
222213
- :func:`to_parquet` now appropriately handles the ``schema`` argument for user defined schemas in the pyarrow engine. (:issue: `30270`)
223214
- DataFrame constructor preserve `ExtensionArray` dtype with `ExtensionArray` (:issue:`11363`)
224215
- :meth:`DataFrame.sort_values` and :meth:`Series.sort_values` have gained ``ignore_index`` keyword to be able to reset index after sorting (:issue:`30114`)
225-
- :meth:`DataFrame.to_markdown` and :meth:`Series.to_markdown` added (:issue:`11052`)
226216
- :meth:`DataFrame.sort_index` and :meth:`Series.sort_index` have gained ``ignore_index`` keyword to reset index (:issue:`30114`)
227217
- :meth:`DataFrame.drop_duplicates` has gained ``ignore_index`` keyword to reset index (:issue:`30114`)
228218
- Added new writer for exporting Stata dta files in version 118, ``StataWriter118``. This format supports exporting strings containing Unicode characters (:issue:`23573`)
@@ -231,7 +221,6 @@ Other enhancements
231221
- :meth:`Timestamp.fromisocalendar` is now compatible with python 3.8 and above (:issue:`28115`)
232222

233223

234-
235224
Build Changes
236225
^^^^^^^^^^^^^
237226

@@ -240,6 +229,8 @@ cythonized files in the source distribution uploaded to PyPI (:issue:`28341`, :i
240229
a built distribution (wheel) or via conda, this shouldn't have any effect on you. If you're building pandas from
241230
source, you should no longer need to install Cython into your build environment before calling ``pip install pandas``.
242231

232+
.. ---------------------------------------------------------------------------
233+
243234
.. _whatsnew_1000.api_breaking:
244235

245236
Backwards incompatible API changes
@@ -458,6 +449,13 @@ consistent with the behaviour of :class:`DataFrame` and :class:`Index`.
458449
DeprecationWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
459450
Series([], dtype: float64)
460451
452+
.. _whatsnew_1000.api_breaking.python:
453+
454+
Increased minimum version for Python
455+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
456+
457+
Pandas 1.0.0 supports Python 3.6.1 and higher (:issue:`29212`).
458+
461459
.. _whatsnew_1000.api_breaking.deps:
462460

463461
Increased minimum versions for dependencies
@@ -555,7 +553,9 @@ Documentation Improvements
555553
^^^^^^^^^^^^^^^^^^^^^^^^^^
556554

557555
- Added new section on :ref:`scale` (:issue:`28315`).
558-
- Added sub-section Query MultiIndex in IO tools user guide (:issue:`28791`)
556+
- Added sub-section on :ref:`io.query_multi` for HDF5 datasets (:issue:`28791`).
557+
558+
.. ---------------------------------------------------------------------------
559559
560560
.. _whatsnew_1000.deprecations:
561561

@@ -613,21 +613,20 @@ a list of items should be used instead. (:issue:`23566`) For example:
613613
# proper way, returns DataFrameGroupBy
614614
g[['B', 'C']]
615615
616+
.. ---------------------------------------------------------------------------
616617
617618
.. _whatsnew_1000.prior_deprecations:
618619

620+
Removal of prior version deprecations/changes
621+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
619622

620-
Removed SparseSeries and SparseDataFrame
621-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
623+
**Removed SparseSeries and SparseDataFrame**
622624

623625
``SparseSeries``, ``SparseDataFrame`` and the ``DataFrame.to_sparse`` method
624626
have been removed (:issue:`28425`). We recommend using a ``Series`` or
625627
``DataFrame`` with sparse values instead. See :ref:`sparse.migration` for help
626628
with migrating existing code.
627629

628-
Removal of prior version deprecations/changes
629-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
630-
631630
.. _whatsnew_1000.matplotlib_units:
632631

633632
**Matplotlib unit registration**
@@ -760,6 +759,8 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
760759
- Calling ``np.array`` and ``np.asarray`` on tz-aware :class:`Series` and :class:`DatetimeIndex` will now return an object array of tz-aware :class:`Timestamp` (:issue:`24596`)
761760
-
762761

762+
.. ---------------------------------------------------------------------------
763+
763764
.. _whatsnew_1000.performance:
764765

765766
Performance improvements
@@ -780,6 +781,8 @@ Performance improvements
780781
- Performance improvement in :meth:`Index.equals` and :meth:`MultiIndex.equals` (:issue:`29134`)
781782
- Performance improvement in :func:`~pandas.api.types.infer_dtype` when ``skipna`` is ``True`` (:issue:`28814`)
782783

784+
.. ---------------------------------------------------------------------------
785+
783786
.. _whatsnew_1000.bug_fixes:
784787

785788
Bug fixes
@@ -1038,6 +1041,8 @@ Other
10381041
- Bug in :meth:`DaataFrame.to_csv` when supplied a series with a ``dtype="string"`` and a ``na_rep``, the ``na_rep`` was being truncated to 2 characters. (:issue:`29975`)
10391042
- Bug where :meth:`DataFrame.itertuples` would incorrectly determine whether or not namedtuples could be used for dataframes of 255 columns (:issue:`28282`)
10401043

1044+
.. ---------------------------------------------------------------------------
1045+
10411046
.. _whatsnew_1000.contributors:
10421047

10431048
Contributors

0 commit comments

Comments
 (0)