Skip to content

Commit 3298528

Browse files
Merge pull request #10101 from jorisvandenbossche/v0.16.1-docs
v0.16.1 docs
2 parents 89b8b81 + fad6079 commit 3298528

File tree

8 files changed

+100
-118
lines changed

8 files changed

+100
-118
lines changed

doc/source/basics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ see :ref:`here<indexing.boolean>`
236236
Boolean Reductions
237237
~~~~~~~~~~~~~~~~~~
238238

239-
You can apply the reductions: :attr:`~DataFrame.empty`, :meth:`~DataFrame.any`,
239+
You can apply the reductions: :attr:`~DataFrame.empty`, :meth:`~DataFrame.any`,
240240
:meth:`~DataFrame.all`, and :meth:`~DataFrame.bool` to provide a
241241
way to summarize a boolean result.
242242

doc/source/categorical.rst

+13-10
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,16 @@ basic type) and applying along columns will also convert to object.
813813
df.apply(lambda row: type(row["cats"]), axis=1)
814814
df.apply(lambda col: col.dtype, axis=0)
815815
816-
No Categorical Index
817-
~~~~~~~~~~~~~~~~~~~~
816+
Categorical Index
817+
~~~~~~~~~~~~~~~~~
818+
819+
.. versionadded:: 0.16.1
820+
821+
A new ``CategoricalIndex`` index type is introduced in version 0.16.1. See the
822+
:ref:`advanced indexing docs <indexing.categoricalindex>` for a more detailed
823+
explanation.
818824

819-
There is currently no index of type ``category``, so setting the index to categorical column will
820-
convert the categorical data to a "normal" dtype first and therefore remove any custom
821-
ordering of the categories:
825+
Setting the index, will create create a ``CategoricalIndex``
822826

823827
.. ipython:: python
824828
@@ -827,13 +831,12 @@ ordering of the categories:
827831
values = [4,2,3,1]
828832
df = DataFrame({"strings":strings, "values":values}, index=cats)
829833
df.index
830-
# This should sort by categories but does not as there is no CategoricalIndex!
834+
# This now sorts by the categories order
831835
df.sort_index()
832836
833-
.. note::
834-
This could change if a `CategoricalIndex` is implemented (see
835-
https://github.com/pydata/pandas/issues/7629)
836-
837+
In previous versions (<0.16.1) there is no index of type ``category``, so
838+
setting the index to categorical column will convert the categorical data to a
839+
"normal" dtype first and therefore remove any custom ordering of the categories.
837840

838841
Side Effects
839842
~~~~~~~~~~~~

doc/source/contributing.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ This creates the directory `pandas-yourname` and connects your repository to
113113
the upstream (main project) *pandas* repository.
114114

115115
The testing suite will run automatically on Travis-CI once your Pull Request is
116-
submitted. However, if you wish to run the test suite on a branch prior to
116+
submitted. However, if you wish to run the test suite on a branch prior to
117117
submitting the Pull Request, then Travis-CI needs to be hooked up to your
118118
GitHub repository. Instructions are for doing so are `here
119-
<http://about.travis-ci.org/docs/user/getting-started/>`_.
119+
<http://about.travis-ci.org/docs/user/getting-started/>`__.
120120

121121
Creating a Branch
122122
-----------------
@@ -219,7 +219,7 @@ To return to you home root environment:
219219
deactivate
220220

221221
See the full ``conda`` docs `here
222-
<http://conda.pydata.org/docs>`_.
222+
<http://conda.pydata.org/docs>`__.
223223

224224
At this point you can easily do an *in-place* install, as detailed in the next section.
225225

@@ -372,7 +372,7 @@ If you want to do a full clean build, do::
372372
Starting with 0.13.1 you can tell ``make.py`` to compile only a single section
373373
of the docs, greatly reducing the turn-around time for checking your changes.
374374
You will be prompted to delete `.rst` files that aren't required. This is okay
375-
since the prior version can be checked out from git, but make sure to
375+
since the prior version can be checked out from git, but make sure to
376376
not commit the file deletions.
377377

378378
::
@@ -401,7 +401,7 @@ Built Master Branch Documentation
401401
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402402

403403
When pull-requests are merged into the pandas *master* branch, the main parts of the documentation are
404-
also built by Travis-CI. These docs are then hosted `here <http://pandas-docs.github.io/pandas-docs-travis>`_.
404+
also built by Travis-CI. These docs are then hosted `here <http://pandas-docs.github.io/pandas-docs-travis>`__.
405405

406406
Contributing to the code base
407407
=============================

doc/source/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pandas at all.
3535
Simply create an account, and have access to pandas from within your brower via
3636
an `IPython Notebook <http://ipython.org/notebook.html>`__ in a few minutes.
3737

38-
.. _install.anaconda
38+
.. _install.anaconda:
3939

4040
Installing pandas with Anaconda
4141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -68,7 +68,7 @@ admin rights to install it, it will install in the user's home directory, and
6868
this also makes it trivial to delete Anaconda at a later date (just delete
6969
that folder).
7070

71-
.. _install.miniconda
71+
.. _install.miniconda:
7272

7373
Installing pandas with Miniconda
7474
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/text.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ Elements in the split lists can be accessed using ``get`` or ``[]`` notation:
8282
s2.str.split('_').str.get(1)
8383
s2.str.split('_').str[1]
8484
85-
Easy to expand this to return a DataFrame using ``return_type``.
85+
Easy to expand this to return a DataFrame using ``expand``.
8686

8787
.. ipython:: python
8888
89-
s2.str.split('_', return_type='frame')
89+
s2.str.split('_', expand=True)
9090
9191
Methods like ``replace`` and ``findall`` take `regular expressions
9292
<https://docs.python.org/2/library/re.html>`__, too:

doc/source/visualization.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ Histogram can be drawn specifying ``kind='hist'``.
220220

221221
.. ipython:: python
222222
223-
df4 = pd.DataFrame({'a': randn(1000) + 1, 'b': randn(1000),
224-
'c': randn(1000) - 1}, columns=['a', 'b', 'c'])
223+
df4 = pd.DataFrame({'a': np.random.randn(1000) + 1, 'b': np.random.randn(1000),
224+
'c': np.random.randn(1000) - 1}, columns=['a', 'b', 'c'])
225225
226226
plt.figure();
227227

doc/source/whatsnew/v0.16.1.txt

+74-95
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,6 @@ Highlights include:
3131
Enhancements
3232
~~~~~~~~~~~~
3333

34-
- ``BusinessHour`` offset is now supported, which represents business hours starting from 09:00 - 17:00 on ``BusinessDay`` by default. See :ref:`Here <timeseries.businesshour>` for details. (:issue:`7905`)
35-
36-
.. ipython:: python
37-
38-
Timestamp('2014-08-01 09:00') + BusinessHour()
39-
Timestamp('2014-08-01 07:00') + BusinessHour()
40-
Timestamp('2014-08-01 16:30') + BusinessHour()
41-
42-
- ``DataFrame.diff`` now takes an ``axis`` parameter that determines the direction of differencing (:issue:`9727`)
43-
44-
- Allow ``clip``, ``clip_lower``, and ``clip_upper`` to accept array-like arguments as thresholds (This is a regression from 0.11.0). These methods now have an ``axis`` parameter which determines how the Series or DataFrame will be aligned with the threshold(s). (:issue:`6966`)
45-
46-
- ``DataFrame.mask()`` and ``Series.mask()`` now support same keywords as ``where`` (:issue:`8801`)
47-
48-
- ``drop`` function can now accept ``errors`` keyword to suppress ``ValueError`` raised when any of label does not exist in the target data. (:issue:`6736`)
49-
50-
.. ipython:: python
51-
52-
df = DataFrame(np.random.randn(3, 3), columns=['A', 'B', 'C'])
53-
df.drop(['A', 'X'], axis=1, errors='ignore')
54-
55-
- Allow conversion of values with dtype ``datetime64`` or ``timedelta64`` to strings using ``astype(str)`` (:issue:`9757`)
56-
- ``get_dummies`` function now accepts ``sparse`` keyword. If set to ``True``, the return ``DataFrame`` is sparse, e.g. ``SparseDataFrame``. (:issue:`8823`)
57-
- ``Period`` now accepts ``datetime64`` as value input. (:issue:`9054`)
58-
59-
- Allow timedelta string conversion when leading zero is missing from time definition, ie `0:00:00` vs `00:00:00`. (:issue:`9570`)
60-
- Allow ``Panel.shift`` with ``axis='items'`` (:issue:`9890`)
61-
62-
- Trying to write an excel file now raises ``NotImplementedError`` if the ``DataFrame`` has a ``MultiIndex`` instead of writing a broken Excel file. (:issue:`9794`)
63-
- Allow ``Categorical.add_categories`` to accept ``Series`` or ``np.array``. (:issue:`9927`)
64-
65-
- Add/delete ``str/dt/cat`` accessors dynamically from ``__dir__``. (:issue:`9910`)
66-
- Add ``normalize`` as a ``dt`` accessor method. (:issue:`10047`)
67-
68-
- ``DataFrame`` and ``Series`` now have ``_constructor_expanddim`` property as overridable constructor for one higher dimensionality data. This should be used only when it is really needed, see :ref:`here <ref-subclassing-pandas>`
69-
70-
- ``pd.lib.infer_dtype`` now returns ``'bytes'`` in Python 3 where appropriate. (:issue:`10032`)
71-
7234
.. _whatsnew_0161.enhancements.categoricalindex:
7335

7436
CategoricalIndex
@@ -188,16 +150,6 @@ String Methods Enhancements
188150
:ref:`Continuing from v0.16.0 <whatsnew_0160.enhancements.string>`, the following
189151
enhancements make string operations easier and more consistent with standard python string operations.
190152

191-
- The following new methods are accesible via ``.str`` accessor to apply the function to each values. (:issue:`9766`, :issue:`9773`, :issue:`10031`, :issue:`10045`, :issue:`10052`)
192-
193-
================ =============== =============== =============== ================
194-
.. .. Methods .. ..
195-
================ =============== =============== =============== ================
196-
``capitalize()`` ``swapcase()`` ``normalize()`` ``partition()`` ``rpartition()``
197-
``index()`` ``rindex()`` ``translate()``
198-
================ =============== =============== =============== ================
199-
200-
201153

202154
- Added ``StringMethods`` (``.str`` accessor) to ``Index`` (:issue:`9068`)
203155

@@ -220,6 +172,14 @@ enhancements make string operations easier and more consistent with standard pyt
220172
idx.str.startswith('a')
221173
s[s.index.str.startswith('a')]
222174

175+
- The following new methods are accesible via ``.str`` accessor to apply the function to each values. (:issue:`9766`, :issue:`9773`, :issue:`10031`, :issue:`10045`, :issue:`10052`)
176+
177+
================ =============== =============== =============== ================
178+
.. .. Methods .. ..
179+
================ =============== =============== =============== ================
180+
``capitalize()`` ``swapcase()`` ``normalize()`` ``partition()`` ``rpartition()``
181+
``index()`` ``rindex()`` ``translate()``
182+
================ =============== =============== =============== ================
223183

224184
- ``split`` now takes ``expand`` keyword to specify whether to expand dimensionality. ``return_type`` is deprecated. (:issue:`9847`)
225185

@@ -244,14 +204,59 @@ enhancements make string operations easier and more consistent with standard pyt
244204

245205
- Improved ``extract`` and ``get_dummies`` methods for ``Index.str`` (:issue:`9980`)
246206

247-
.. _whatsnew_0161.api:
248207

249-
API changes
250-
~~~~~~~~~~~
208+
.. _whatsnew_0161.enhancements.other:
209+
210+
Other Enhancements
211+
^^^^^^^^^^^^^^^^^^
212+
213+
- ``BusinessHour`` offset is now supported, which represents business hours starting from 09:00 - 17:00 on ``BusinessDay`` by default. See :ref:`Here <timeseries.businesshour>` for details. (:issue:`7905`)
214+
215+
.. ipython:: python
251216

217+
from pandas.tseries.offsets import BusinessHour
218+
Timestamp('2014-08-01 09:00') + BusinessHour()
219+
Timestamp('2014-08-01 07:00') + BusinessHour()
220+
Timestamp('2014-08-01 16:30') + BusinessHour()
252221

222+
- ``DataFrame.diff`` now takes an ``axis`` parameter that determines the direction of differencing (:issue:`9727`)
253223

224+
- Allow ``clip``, ``clip_lower``, and ``clip_upper`` to accept array-like arguments as thresholds (This is a regression from 0.11.0). These methods now have an ``axis`` parameter which determines how the Series or DataFrame will be aligned with the threshold(s). (:issue:`6966`)
225+
226+
- ``DataFrame.mask()`` and ``Series.mask()`` now support same keywords as ``where`` (:issue:`8801`)
254227

228+
- ``drop`` function can now accept ``errors`` keyword to suppress ``ValueError`` raised when any of label does not exist in the target data. (:issue:`6736`)
229+
230+
.. ipython:: python
231+
232+
df = DataFrame(np.random.randn(3, 3), columns=['A', 'B', 'C'])
233+
df.drop(['A', 'X'], axis=1, errors='ignore')
234+
235+
- Add support for separating years and quarters using dashes, for
236+
example 2014-Q1. (:issue:`9688`)
237+
238+
- Allow conversion of values with dtype ``datetime64`` or ``timedelta64`` to strings using ``astype(str)`` (:issue:`9757`)
239+
- ``get_dummies`` function now accepts ``sparse`` keyword. If set to ``True``, the return ``DataFrame`` is sparse, e.g. ``SparseDataFrame``. (:issue:`8823`)
240+
- ``Period`` now accepts ``datetime64`` as value input. (:issue:`9054`)
241+
242+
- Allow timedelta string conversion when leading zero is missing from time definition, ie `0:00:00` vs `00:00:00`. (:issue:`9570`)
243+
- Allow ``Panel.shift`` with ``axis='items'`` (:issue:`9890`)
244+
245+
- Trying to write an excel file now raises ``NotImplementedError`` if the ``DataFrame`` has a ``MultiIndex`` instead of writing a broken Excel file. (:issue:`9794`)
246+
- Allow ``Categorical.add_categories`` to accept ``Series`` or ``np.array``. (:issue:`9927`)
247+
248+
- Add/delete ``str/dt/cat`` accessors dynamically from ``__dir__``. (:issue:`9910`)
249+
- Add ``normalize`` as a ``dt`` accessor method. (:issue:`10047`)
250+
251+
- ``DataFrame`` and ``Series`` now have ``_constructor_expanddim`` property as overridable constructor for one higher dimensionality data. This should be used only when it is really needed, see :ref:`here <ref-subclassing-pandas>`
252+
253+
- ``pd.lib.infer_dtype`` now returns ``'bytes'`` in Python 3 where appropriate. (:issue:`10032`)
254+
255+
256+
.. _whatsnew_0161.api:
257+
258+
API changes
259+
~~~~~~~~~~~
255260

256261
- When passing in an ax to ``df.plot( ..., ax=ax)``, the `sharex` kwarg will now default to `False`.
257262
The result is that the visibility of xlabels and xticklabels will not anymore be changed. You
@@ -260,16 +265,19 @@ API changes
260265
If pandas creates the subplots itself (e.g. no passed in `ax` kwarg), then the
261266
default is still ``sharex=True`` and the visibility changes are applied.
262267

263-
264-
265-
- Add support for separating years and quarters using dashes, for
266-
example 2014-Q1. (:issue:`9688`)
267-
268268
- :meth:`~pandas.DataFrame.assign` now inserts new columns in alphabetical order. Previously
269269
the order was arbitrary. (:issue:`9777`)
270270

271271
- By default, ``read_csv`` and ``read_table`` will now try to infer the compression type based on the file extension. Set ``compression=None`` to restore the previous behavior (no decompression). (:issue:`9770`)
272272

273+
.. _whatsnew_0161.deprecations:
274+
275+
Deprecations
276+
^^^^^^^^^^^^
277+
278+
- ``Series.str.split``'s ``return_type`` keyword was removed in favor of ``expand`` (:issue:`9847`)
279+
280+
273281
.. _whatsnew_0161.index_repr:
274282

275283
Index Representation
@@ -303,25 +311,17 @@ New Behavior
303311

304312
.. ipython:: python
305313

306-
pd.set_option('display.width',100)
307-
pd.Index(range(4),name='foo')
308-
pd.Index(range(25),name='foo')
309-
pd.Index(range(104),name='foo')
310-
pd.Index(['datetime', 'sA', 'sB', 'sC', 'flow', 'error', 'temp', 'ref', 'a_bit_a_longer_one']*2)
311-
pd.CategoricalIndex(['a','bb','ccc','dddd'],ordered=True,name='foobar')
312-
pd.CategoricalIndex(['a','bb','ccc','dddd']*10,ordered=True,name='foobar')
313-
pd.CategoricalIndex(['a','bb','ccc','dddd']*100,ordered=True,name='foobar')
314-
pd.CategoricalIndex(np.arange(1000),ordered=True,name='foobar')
315-
pd.date_range('20130101',periods=4,name='foo',tz='US/Eastern')
316-
pd.date_range('20130101',periods=25,name='foo',tz='US/Eastern')
317-
pd.date_range('20130101',periods=104,name='foo',tz='US/Eastern')
318-
319-
.. _whatsnew_0161.deprecations:
314+
pd.set_option('display.width', 80)
315+
pd.Index(range(4), name='foo')
316+
pd.Index(range(30), name='foo')
317+
pd.Index(range(104), name='foo')
318+
pd.CategoricalIndex(['a','bb','ccc','dddd'], ordered=True, name='foobar')
319+
pd.CategoricalIndex(['a','bb','ccc','dddd']*10, ordered=True, name='foobar')
320+
pd.CategoricalIndex(['a','bb','ccc','dddd']*100, ordered=True, name='foobar')
321+
pd.date_range('20130101',periods=4, name='foo', tz='US/Eastern')
322+
pd.date_range('20130101',periods=25, freq='D')
323+
pd.date_range('20130101',periods=104, name='foo', tz='US/Eastern')
320324

321-
Deprecations
322-
^^^^^^^^^^^^
323-
324-
- ``Series.str.split``'s ``return_type`` keyword was removed in favor of ``expand`` (:issue:`9847`)
325325

326326
.. _whatsnew_0161.performance:
327327

@@ -333,7 +333,6 @@ Performance Improvements
333333
- Improved the performance of ``pd.lib.max_len_string_array`` by 5-7x (:issue:`10024`)
334334

335335

336-
337336
.. _whatsnew_0161.bug_fixes:
338337

339338
Bug Fixes
@@ -361,7 +360,6 @@ Bug Fixes
361360
- Bug where repeated plotting of ``DataFrame`` with a ``DatetimeIndex`` may raise ``TypeError`` (:issue:`9852`)
362361
- Bug in ``setup.py`` that would allow an incompat cython version to build (:issue:`9827`)
363362
- Bug in plotting ``secondary_y`` incorrectly attaches ``right_ax`` property to secondary axes specifying itself recursively. (:issue:`9861`)
364-
365363
- Bug in ``Series.quantile`` on empty Series of type ``Datetime`` or ``Timedelta`` (:issue:`9675`)
366364
- Bug in ``where`` causing incorrect results when upcasting was required (:issue:`9731`)
367365
- Bug in ``FloatArrayFormatter`` where decision boundary for displaying "small" floats in decimal format is off by one order of magnitude for a given display.precision (:issue:`9764`)
@@ -372,20 +370,13 @@ Bug Fixes
372370
- Bug in index equality comparisons using ``==`` failing on Index/MultiIndex type incompatibility (:issue:`9785`)
373371
- Bug in which ``SparseDataFrame`` could not take `nan` as a column name (:issue:`8822`)
374372
- Bug in ``to_msgpack`` and ``read_msgpack`` zlib and blosc compression support (:issue:`9783`)
375-
376373
- Bug ``GroupBy.size`` doesn't attach index name properly if grouped by ``TimeGrouper`` (:issue:`9925`)
377374
- Bug causing an exception in slice assignments because ``length_of_indexer`` returns wrong results (:issue:`9995`)
378375
- Bug in csv parser causing lines with initial whitespace plus one non-space character to be skipped. (:issue:`9710`)
379376
- Bug in C csv parser causing spurious NaNs when data started with newline followed by whitespace. (:issue:`10022`)
380-
381377
- Bug causing elements with a null group to spill into the final group when grouping by a ``Categorical`` (:issue:`9603`)
382378
- Bug where .iloc and .loc behavior is not consistent on empty dataframes (:issue:`9964`)
383-
384379
- Bug in invalid attribute access on a ``TimedeltaIndex`` incorrectly raised ``ValueError`` instead of ``AttributeError`` (:issue:`9680`)
385-
386-
387-
388-
389380
- Bug in unequal comparisons between categorical data and a scalar, which was not in the categories (e.g. ``Series(Categorical(list("abc"), ordered=True)) > "d"``. This returned ``False`` for all elements, but now raises a ``TypeError``. Equality comparisons also now return ``False`` for ``==`` and ``True`` for ``!=``. (:issue:`9848`)
390381
- Bug in DataFrame ``__setitem__`` when right hand side is a dictionary (:issue:`9874`)
391382
- Bug in ``where`` when dtype is ``datetime64/timedelta64``, but dtype of other is not (:issue:`9804`)
@@ -394,25 +385,13 @@ Bug Fixes
394385
- Bug in ``DataFrame`` constructor when ``columns`` parameter is set, and ``data`` is an empty list (:issue:`9939`)
395386
- Bug in bar plot with ``log=True`` raises ``TypeError`` if all values are less than 1 (:issue:`9905`)
396387
- Bug in horizontal bar plot ignores ``log=True`` (:issue:`9905`)
397-
398-
399-
400388
- Bug in PyTables queries that did not return proper results using the index (:issue:`8265`, :issue:`9676`)
401-
402-
403-
404-
405389
- Bug where dividing a dataframe containing values of type ``Decimal`` by another ``Decimal`` would raise. (:issue:`9787`)
406390
- Bug where using DataFrames asfreq would remove the name of the index. (:issue:`9885`)
407391
- Bug causing extra index point when resample BM/BQ (:issue:`9756`)
408392
- Changed caching in ``AbstractHolidayCalendar`` to be at the instance level rather than at the class level as the latter can result in unexpected behaviour. (:issue:`9552`)
409-
410393
- Fixed latex output for multi-indexed dataframes (:issue:`9778`)
411394
- Bug causing an exception when setting an empty range using ``DataFrame.loc`` (:issue:`9596`)
412-
413-
414-
415-
416395
- Bug in hiding ticklabels with subplots and shared axes when adding a new plot to an existing grid of axes (:issue:`9158`)
417396
- Bug in ``transform`` and ``filter`` when grouping on a categorical variable (:issue:`9921`)
418397
- Bug in ``transform`` when groups are equal in number and dtype to the input index (:issue:`9700`)

0 commit comments

Comments
 (0)