Skip to content

Commit 0a7cd97

Browse files
committed
DOC: whatsnew 0.20 and timeseries doc fixes
1 parent 4c3d4d4 commit 0a7cd97

File tree

2 files changed

+41
-33
lines changed

2 files changed

+41
-33
lines changed

doc/source/timeseries.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,11 @@ If the timestamp string is treated as a slice, it can be used to index ``DataFra
527527
dft_minute['2011-12-31 23']
528528
529529
530-
:: warning::
530+
.. warning::
531531

532-
However if the string is treated as an exact match the selection in ``DataFrame``'s ``[]`` will be column-wise and not row-wise, see :ref:`Indexing Basics <indexing.basics>`. For example ``dft_minute['2011-12-31 23:59']`` will raise ``KeyError`` as ``'2012-12-31 23:59'`` has the same resolution as index and there is no column with such name:
532+
However if the string is treated as an exact match, the selection in ``DataFrame``'s ``[]`` will be column-wise and not row-wise, see :ref:`Indexing Basics <indexing.basics>`. For example ``dft_minute['2011-12-31 23:59']`` will raise ``KeyError`` as ``'2012-12-31 23:59'`` has the same resolution as index and there is no column with such name:
533533

534-
To select a single row, use ``.loc``.
534+
To *always* have unambiguous selection, whether the row is treated as a slice or a single selection, use ``.loc``.
535535

536536
.. ipython:: python
537537

doc/source/whatsnew/v0.20.0.txt

+38-30
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ New features
2323
~~~~~~~~~~~~
2424

2525

26+
.. _whatsnew_0200.enhancements.dataio_dtype:
27+
2628
``dtype`` keyword for data IO
2729
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2830

@@ -106,7 +108,7 @@ Other enhancements
106108
- ``pd.Series.interpolate`` now supports timedelta as an index type with ``method='time'`` (:issue:`6424`)
107109
- ``pandas.io.json.json_normalize()`` gained the option ``errors='ignore'|'raise'``; the default is ``errors='raise'`` which is backward compatible. (:issue:`14583`)
108110

109-
- ``.select_dtypes()`` now allows `datetimetz` to generically select datetimes with tz (:issue:`14910`)
111+
- ``.select_dtypes()`` now allows the string 'datetimetz' to generically select datetimes with tz (:issue:`14910`)
110112

111113

112114
.. _whatsnew_0200.api_breaking:
@@ -157,7 +159,7 @@ Map on Index types now return other Index types
157159
mi.map(lambda x: x[0])
158160

159161

160-
- ``map`` on a Series with datetime64 values may return int64 dtypes rather than int32
162+
- ``map`` on a ``Series`` with ``datetime64`` values may return ``int64`` dtypes rather than ``int32``
161163

162164
.. ipython:: python
163165

@@ -182,53 +184,59 @@ Map on Index types now return other Index types
182184

183185
s.map(lambda x: x.hour)
184186

185-
.. _whatsnew_0200.s3:
187+
.. _whatsnew_0200.api_breaking.s3:
186188

187189
S3 File Handling
188190
^^^^^^^^^^^^^^^^
189191

190192
pandas now uses `s3fs <http://s3fs.readthedocs.io/>`_ for handling S3 connections. This shouldn't break
191-
any code. However, since s3fs is not a required dependency, you will need to install it separately (like boto
192-
in prior versions of pandas) (:issue:`11915`).
193+
any code. However, since s3fs is not a required dependency, you will need to install it separately, like ``boto``
194+
in prior versions of pandas. (:issue:`11915`).
193195

194-
.. _whatsnew_0200.api:
196+
.. _whatsnew_0200.api_breaking.partial_string_indexing:
195197

196-
Other API Changes
197-
^^^^^^^^^^^^^^^^^
198+
Partial String Indexing Changes
199+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198200

199-
- ``CParserError`` has been renamed to ``ParserError`` in ``pd.read_csv`` and will be removed in the future (:issue:`12665`)
200-
- ``SparseArray.cumsum()`` and ``SparseSeries.cumsum()`` will now always return ``SparseArray`` and ``SparseSeries`` respectively (:issue:`12855`)
201-
- :ref:`DatetimeIndex Partial String Indexing <timeseries.partialindexing>` now works as exact match provided that string resolution coincides with index resolution, including a case when both are seconds (:issue:`14826`). See :ref:`Slice vs. Exact Match <timeseries.slice_vs_exact_match>` for details.
201+
:ref:`DatetimeIndex Partial String Indexing <timeseries.partialindexing>` now works as exact match, provided that string resolution coincides with index resolution, including a case when both are seconds (:issue:`14826`). See :ref:`Slice vs. Exact Match <timeseries.slice_vs_exact_match>` for details.
202202

203-
.. ipython:: python
203+
.. ipython:: python
204204

205-
df = DataFrame({'a': [1, 2, 3]}, DatetimeIndex(['2011-12-31 23:59:59',
206-
'2012-01-01 00:00:00',
207-
'2012-01-01 00:00:01']))
208-
Previous Behavior:
205+
df = DataFrame({'a': [1, 2, 3]}, DatetimeIndex(['2011-12-31 23:59:59',
206+
'2012-01-01 00:00:00',
207+
'2012-01-01 00:00:01']))
208+
Previous Behavior:
209209

210-
.. code-block:: ipython
210+
.. code-block:: ipython
211211

212-
In [4]: df['2011-12-31 23:59:59']
213-
Out[4]:
212+
In [4]: df['2011-12-31 23:59:59']
213+
Out[4]:
214214
a
215-
2011-12-31 23:59:59 1
215+
2011-12-31 23:59:59 1
216216

217-
In [5]: df['a']['2011-12-31 23:59:59']
218-
Out[5]:
219-
2011-12-31 23:59:59 1
220-
Name: a, dtype: int64
217+
In [5]: df['a']['2011-12-31 23:59:59']
218+
Out[5]:
219+
2011-12-31 23:59:59 1
220+
Name: a, dtype: int64
221221

222222

223-
New Behavior:
223+
New Behavior:
224224

225-
.. code-block:: ipython
225+
.. code-block:: ipython
226+
227+
In [4]: df['2011-12-31 23:59:59']
228+
KeyError: '2011-12-31 23:59:59'
229+
230+
In [5]: df['a']['2011-12-31 23:59:59']
231+
Out[5]: 1
232+
233+
.. _whatsnew_0200.api:
226234

227-
In [4]: df['2011-12-31 23:59:59']
228-
KeyError: '2011-12-31 23:59:59'
235+
Other API Changes
236+
^^^^^^^^^^^^^^^^^
229237

230-
In [5]: df['a']['2011-12-31 23:59:59']
231-
Out[5]: 1
238+
- ``CParserError`` has been renamed to ``ParserError`` in ``pd.read_csv`` and will be removed in the future (:issue:`12665`)
239+
- ``SparseArray.cumsum()`` and ``SparseSeries.cumsum()`` will now always return ``SparseArray`` and ``SparseSeries`` respectively (:issue:`12855`)
232240

233241
.. _whatsnew_0200.deprecations:
234242

0 commit comments

Comments
 (0)