forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathv0.15.1.txt
199 lines (107 loc) · 5.33 KB
/
v0.15.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
.. _whatsnew_0151:
v0.15.1 (November ??, 2014)
-----------------------
This is a minor release from 0.15.0 and includes a small number of API changes, several new features,
enhancements, and performance improvements along with a large number of bug fixes. We recommend that all
users upgrade to this version.
- Highlights include:
- :ref:`Enhancements <whatsnew_0151.enhancements>`
- :ref:`API Changes <whatsnew_0151.api>`
- :ref:`Performance Improvements <whatsnew_0151.performance>`
- :ref:`Experimental Changes <whatsnew_0151.experimental>`
- :ref:`Bug Fixes <whatsnew_0151.bug_fixes>`
.. _whatsnew_0151.api:
API changes
~~~~~~~~~~~
- Represent ``MultiIndex`` labels with a dtype that utilizes memory based on the level size. In prior versions, the memory usage was a constant 8 bytes per element in each level. In addition, in prior versions, the *reported* memory usage was incorrect as it didn't show the usage for the memory occupied by the underling data array. (:issue:`8456`)
.. ipython:: python
dfi = DataFrame(1,index=pd.MultiIndex.from_product([['a'],range(1000)]),columns=['A'])
previous behavior:
.. code-block:: python
# this was underreported and actually took (in < 0.15.1) about 24008 bytes
In [1]: dfi.memory_usage(index=True)
Out[1]:
Index 8000
A 8000
dtype: int64
current behavior:
.. ipython:: python
dfi.memory_usage(index=True)
- ``groupby`` with ``as_index=False`` will not add erroneous extra columns to
result (:issue:`8582`):
.. ipython:: python
np.random.seed(2718281)
df = pd.DataFrame(np.random.randint(0, 100, (10, 2)),
columns=['jim', 'joe'])
df.head()
ts = pd.Series(5 * np.random.randint(0, 3, 10))
previous behavior:
.. code-block:: python
In [4]: df.groupby(ts, as_index=False).max()
Out[4]:
NaN jim joe
0 0 72 83
1 5 77 84
2 10 96 65
current behavior:
.. ipython:: python
df.groupby(ts, as_index=False).max()
- ``groupby`` will not erroneously exclude columns if the column name conflics
with the grouper name (:issue:`8112`):
.. ipython:: python
df = pd.DataFrame({'jim': range(5), 'joe': range(5, 10)})
df
gr = df.groupby(df['jim'] < 2)
previous behavior (excludes 1st column from output):
.. code-block:: python
In [4]: gr.apply(sum)
Out[4]:
joe
jim
False 24
True 11
current behavior:
.. ipython:: python
gr.apply(sum)
- ``concat`` permits a wider variety of iterables of pandas objects to be
passed as the first parameter (:issue:`8645`):
.. ipython:: python
from collections import deque
df1 = pd.DataFrame([1, 2, 3])
df2 = pd.DataFrame([4, 5, 6])
previous behavior:
.. code-block:: python
In [7]: pd.concat(deque((df1, df2)))
TypeError: first argument must be a list-like of pandas objects, you passed an object of type "deque"
current behavior:
.. ipython:: python
pd.concat(deque((df1, df2)))
.. _whatsnew_0151.enhancements:
Enhancements
~~~~~~~~~~~~
- Added option to select columns when importing Stata files (:issue:`7935`)
- Qualify memory usage in ``DataFrame.info()`` by adding ``+`` if it is a lower bound (:issue:`8578`)
- Raise errors in certain aggregation cases where an argument such as ``numeric_only`` is not handled (:issue:`8592`).
- Added support for 3-character ISO and non-standard country codes in :func:``io.wb.download()`` (:issue:`8482`)
- :ref:`World Bank data requests <remote_data.wb>` now will warn/raise based on an ``errors`` argument, as well as a list of hard-coded country codes and the World Bank's JSON response. In prior versions, the error messages didn't look at the World Bank's JSON response. Problem-inducing input were simply dropped prior to the request. The issue was that many good countries were cropped in the hard-coded approach. All countries will work now, but some bad countries will raise exceptions because some edge cases break the entire response. (:issue:`8482`)
.. _whatsnew_0151.performance:
Performance
~~~~~~~~~~~
.. _whatsnew_0151.experimental:
Experimental
~~~~~~~~~~~~
.. _whatsnew_0151.bug_fixes:
Bug Fixes
~~~~~~~~~
- Bug in coercing ``Categorical`` to a records array, e.g. ``df.to_records()`` (:issue:`8626`)
- Bug in ``Categorical`` not created properly with ``Series.to_frame()`` (:issue:`8626`)
- Bug in coercing in astype of a ``Categorical`` of a passed ``pd.Categorical`` (this now raises ``TypeError`` correctly), (:issue:`8626`)
- Bug in ``cut``/``qcut`` when using ``Series`` and ``retbins=True`` (:issue:`8589`)
- Bug in numeric index operations of add/sub with Float/Index Index with numpy arrays (:issue:`8608`
- Bug in setitem with empty indexer and unwanted coercion of dtypes (:issue:`8669`)
- Bug in ix/loc block splitting on setitem (manifests with integer-like dtypes, e.g. datetime64) (:issue:`8607`)
- Fix ``shape`` attribute for ``MultiIndex`` (:issue:`8609`)
- Bug in ``GroupBy`` where a name conflict between the grouper and columns
would break ``groupby`` operations (:issue:`7115`, :issue:`8112`)
- Fixed a bug where plotting a column ``y`` and specifying a label would mutate the index name of the original DataFrame (:issue:`8494`)
- Bug in ``date_range`` where partially-specified dates would incorporate current date (:issue:`6961`)