@@ -8,13 +8,13 @@ enhancements along with a large number of bug fixes.
8
8
9
9
Highlites include a consistent I/O API naming scheme, routines to read html,
10
10
write multi-indexes to csv files, read & write STATA data files, read & write JSON format
11
- files, Python 3 support for ``HDFStore``, filtering of groupby expressions via ``filter``, and a
11
+ files, Python 3 support for ``HDFStore``, filtering of groupby expressions via ``filter``, and a
12
12
revamped ``replace`` routine that accepts regular expressions.
13
13
14
14
API changes
15
15
~~~~~~~~~~~
16
16
17
- - The I/O API is now much more consistent with a set of top level ``reader`` functions
17
+ - The I/O API is now much more consistent with a set of top level ``reader`` functions
18
18
accessed like ``pd.read_csv()`` that generally return a ``pandas`` object.
19
19
20
20
* ``read_csv``
@@ -38,7 +38,7 @@ API changes
38
38
* ``to_clipboard``
39
39
40
40
41
- - Fix modulo and integer division on Series,DataFrames to act similary to ``float`` dtypes to return
41
+ - Fix modulo and integer division on Series,DataFrames to act similary to ``float`` dtypes to return
42
42
``np.nan`` or ``np.inf`` as appropriate (:issue:`3590`). This correct a numpy bug that treats ``integer``
43
43
and ``float`` dtypes differently.
44
44
@@ -50,15 +50,15 @@ API changes
50
50
p / p
51
51
p / 0
52
52
53
- - Add ``squeeze`` keyword to ``groupby`` to allow reduction from
53
+ - Add ``squeeze`` keyword to ``groupby`` to allow reduction from
54
54
DataFrame -> Series if groups are unique. This is a Regression from 0.10.1.
55
- We are reverting back to the prior behavior. This means groupby will return the
56
- same shaped objects whether the groups are unique or not. Revert this issue (:issue:`2893`)
55
+ We are reverting back to the prior behavior. This means groupby will return the
56
+ same shaped objects whether the groups are unique or not. Revert this issue (:issue:`2893`)
57
57
with (:issue:`3596`).
58
58
59
59
.. ipython:: python
60
60
61
- df2 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19},
61
+ df2 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19},
62
62
{"val1":1, "val2": 27}, {"val1":1, "val2": 12}])
63
63
def func(dataf):
64
64
return dataf["val2"] - dataf["val2"].mean()
@@ -96,9 +96,9 @@ API changes
96
96
and thus you should cast to an appropriate numeric dtype if you need to
97
97
plot something.
98
98
99
- - Add ``colormap`` keyword to DataFrame plotting methods. Accepts either a
100
- matplotlib colormap object (ie, matplotlib.cm.jet) or a string name of such
101
- an object (ie, 'jet'). The colormap is sampled to select the color for each
99
+ - Add ``colormap`` keyword to DataFrame plotting methods. Accepts either a
100
+ matplotlib colormap object (ie, matplotlib.cm.jet) or a string name of such
101
+ an object (ie, 'jet'). The colormap is sampled to select the color for each
102
102
column. Please see :ref:`visualization.colormaps` for more information.
103
103
(:issue:`3860`)
104
104
@@ -159,6 +159,18 @@ API changes
159
159
``bs4`` + ``html5lib`` when lxml fails to parse. a list of parsers to try
160
160
until success is also valid
161
161
162
+ - The internal ``pandas`` class hierarchy has changed (slightly). The
163
+ previous ``PandasObject`` now is called ``PandasContainer`` and a new
164
+ ``PandasObject`` has become the baseclass for ``PandasContainer`` as well
165
+ as ``Index``, ``Categorical``, ``GroupBy``, ``SparseList``, and
166
+ ``SparseArray`` (+ their base classes). Currently, ``PandasObject``
167
+ provides string methods (from ``StringMixin``). (:issue:`4090`, :issue:`4092`)
168
+
169
+ - New ``StringMixin`` that, given a ``__unicode__`` method, gets python 2 and
170
+ python 3 compatible string methods (``__str__``, ``__bytes__``, and
171
+ ``__repr__``). Plus string safety throughout. Now employed in many places
172
+ throughout the pandas library. (:issue:`4090`, :issue:`4092`)
173
+
162
174
I/O Enhancements
163
175
~~~~~~~~~~~~~~~~
164
176
@@ -184,7 +196,7 @@ I/O Enhancements
184
196
185
197
.. warning::
186
198
187
- You may have to install an older version of BeautifulSoup4,
199
+ You may have to install an older version of BeautifulSoup4,
188
200
:ref:`See the installation docs<install.optional_dependencies>`
189
201
190
202
- Added module for reading and writing Stata files: ``pandas.io.stata`` (:issue:`1512`)
@@ -203,15 +215,15 @@ I/O Enhancements
203
215
- The option, ``tupleize_cols`` can now be specified in both ``to_csv`` and
204
216
``read_csv``, to provide compatiblity for the pre 0.12 behavior of
205
217
writing and reading multi-index columns via a list of tuples. The default in
206
- 0.12 is to write lists of tuples and *not* interpret list of tuples as a
207
- multi-index column.
218
+ 0.12 is to write lists of tuples and *not* interpret list of tuples as a
219
+ multi-index column.
208
220
209
221
Note: The default behavior in 0.12 remains unchanged, but starting with 0.13,
210
- the default *to* write and read multi-index columns will be in the new
222
+ the default *to* write and read multi-index columns will be in the new
211
223
format. (:issue:`3571`, :issue:`1651`, :issue:`3141`)
212
224
213
225
- If an ``index_col`` is not specified (e.g. you don't have an index, or wrote it
214
- with ``df.to_csv(..., index=False``), then any ``names`` on the columns index will
226
+ with ``df.to_csv(..., index=False``), then any ``names`` on the columns index will
215
227
be *lost*.
216
228
217
229
.. ipython:: python
@@ -296,8 +308,8 @@ Other Enhancements
296
308
pd.get_option('a.b')
297
309
pd.get_option('b.c')
298
310
299
- - The ``filter`` method for group objects returns a subset of the original
300
- object. Suppose we want to take only elements that belong to groups with a
311
+ - The ``filter`` method for group objects returns a subset of the original
312
+ object. Suppose we want to take only elements that belong to groups with a
301
313
group sum greater than 2.
302
314
303
315
.. ipython:: python
@@ -317,7 +329,7 @@ Other Enhancements
317
329
dff.groupby('B').filter(lambda x: len(x) > 2)
318
330
319
331
Alternatively, instead of dropping the offending groups, we can return a
320
- like-indexed objects where the groups that do not pass the filter are
332
+ like-indexed objects where the groups that do not pass the filter are
321
333
filled with NaNs.
322
334
323
335
.. ipython:: python
@@ -333,9 +345,9 @@ Experimental Features
333
345
334
346
- Added experimental ``CustomBusinessDay`` class to support ``DateOffsets``
335
347
with custom holiday calendars and custom weekmasks. (:issue:`2301`)
336
-
348
+
337
349
.. note::
338
-
350
+
339
351
This uses the ``numpy.busdaycalendar`` API introduced in Numpy 1.7 and
340
352
therefore requires Numpy 1.7.0 or newer.
341
353
@@ -416,7 +428,7 @@ Bug Fixes
416
428
- Extend ``reindex`` to correctly deal with non-unique indices (:issue:`3679`)
417
429
- ``DataFrame.itertuples()`` now works with frames with duplicate column
418
430
names (:issue:`3873`)
419
- - Bug in non-unique indexing via ``iloc`` (:issue:`4017`); added ``takeable`` argument to
431
+ - Bug in non-unique indexing via ``iloc`` (:issue:`4017`); added ``takeable`` argument to
420
432
``reindex`` for location-based taking
421
433
422
434
- ``DataFrame.from_records`` did not accept empty recarrays (:issue:`3682`)
0 commit comments