forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathv0.11.1.txt
98 lines (75 loc) · 3.79 KB
/
v0.11.1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.. _whatsnew_0111:
v0.11.1 (??)
------------------------
This is a major release from 0.11.0 and includes many new features and
enhancements along with a large number of bug fixes.
API changes
~~~~~~~~~~~
- Fix modulo and integer division on Series,DataFrames to act similary to ``float`` dtypes to return
``np.nan`` or ``np.inf`` as appropriate (GH3590_). This correct a numpy bug that treats ``integer``
and ``float`` dtypes differently.
.. ipython:: python
p = DataFrame({ 'first' : [3,4,5,8], 'second' : [0,0,0,3] })
p % 0
p % p
p / p
p / 0
- Add ``squeeze`` keyword to ``groupby`` to allow reduction from
DataFrame -> Series if groups are unique. This is a Regression from 0.10.1.
We are reverting back to the prior behavior. This means groupby will return the
same shaped objects whether the groups are unique or not. revert on (GH2893_)
with (GH3596_).
.. ipython:: python
df2 = DataFrame([{"val1": 1, "val2" : 20}, {"val1":1, "val2": 19},
{"val1":1, "val2": 27}, {"val1":1, "val2": 12}])
def func(dataf):
return dataf["val2"] - dataf["val2"].mean()
# squeezing the result frame to a series (because we have unique groups)
df2.groupby("val1", squeeze=True).apply(func)
# no squeezing (the default, and behavior in 0.10.1)
df2.groupby("val1").apply(func)
- Raise on ``iloc`` when boolean indexing with a label based indexer mask
e.g. a boolean Series, even with integer labels, will raise. Since ``iloc``
is purely positional based, the labels on the Series are not alignable (GH3631_)
This case is rarely used, and there are plently of alternatives. This preserves the
``iloc`` API to be *purely* positional based.
.. ipython:: python
df = DataFrame(range(5), list('ABCDE'), columns=['a'])
mask = (df.a%2 == 0)
mask
# this is what you should use
df.loc[mask]
# this will work as well
df.iloc[mask.values]
``df.iloc[mask]`` will raise a ``ValueError``
Enhancements
~~~~~~~~~~~~
- ``pd.read_html()`` can now parse HTML string, files or urls and return dataframes
courtesy of @cpcloud. (GH3477_)
- ``HDFStore``
- will retain index attributes (freq,tz,name) on recreation (GH3499_)
- will warn with a AttributeConflictWarning if you are attempting to append
an index with a different frequency than the existing, or attempting
to append an index with a different name than the existing
- support datelike columns with a timezone as data_columns (GH2852_)
- ``fillna`` methods now raise a ``TypeError`` if the ``value`` parameter is
a list or tuple.
- Added module for reading and writing Stata files: pandas.io.stata (GH1512_)
- ``DataFrame.replace()`` now allows regular expressions on contained
``Series`` with object dtype. See the examples section in the regular docs
:ref:`Replacing via String Expression <missing_data.replace_expression>`
See the `full release notes
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
on GitHub for a complete list.
.. _GH2437: https://github.com/pydata/pandas/issues/2437
.. _GH2852: https://github.com/pydata/pandas/issues/2852
.. _GH3477: https://github.com/pydata/pandas/issues/3477
.. _GH3492: https://github.com/pydata/pandas/issues/3492
.. _GH3499: https://github.com/pydata/pandas/issues/3499
.. _GH2893: https://github.com/pydata/pandas/issues/2893
.. _GH3596: https://github.com/pydata/pandas/issues/3596
.. _GH3590: https://github.com/pydata/pandas/issues/3590
.. _GH3435: https://github.com/pydata/pandas/issues/3435
.. _GH1512: https://github.com/pydata/pandas/issues/1512
.. _GH2285: https://github.com/pydata/pandas/issues/2285
.. _GH3631: https://github.com/pydata/pandas/issues/3631