forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv0.15.1.txt
290 lines (172 loc) · 8.75 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
.. _whatsnew_0151:
v0.15.1 (November 8, 2014)
--------------------------
This is a minor bug-fix 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.
- :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 in prior versions
In [1]: dfi.memory_usage(index=True)
Out[1]:
Index 8000 # took about 24008 bytes in < 0.15.1
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)))
- ``s.dt.hour`` and other ``.dt`` accessors will now return ``np.nan`` for missing values (rather than previously -1), (:issue:`8689`)
.. ipython:: python
s = Series(date_range('20130101',periods=5,freq='D'))
s.iloc[2] = np.nan
s
previous behavior:
.. code-block:: python
In [6]: s.dt.hour
Out[6]:
0 0
1 0
2 -1
3 0
4 0
dtype: int64
current behavior:
.. ipython:: python
s.dt.hour
- support for slicing with monotonic decreasing indexes, even if ``start`` or ``stop`` is
not found in the index (:issue:`7860`):
.. ipython:: python
s = pd.Series(['a', 'b', 'c', 'd'], [4, 3, 2, 1])
s
previous behavior:
.. code-block:: python
In [8]: s.loc[3.5:1.5]
KeyError: 3.5
current behavior:
.. ipython:: python
s.loc[3.5:1.5]
- added Index properties `is_monotonic_increasing` and `is_monotonic_decreasing` (:issue:`8680`).
.. note:: io.data.Options has been fixed for a change in the format of the Yahoo Options page (:issue:`8612`)
As a result of a change in Yahoo's option page layout, when an expiry date is given,
``Options`` methods now return data for a single expiry date. Previously, methods returned all
data for the selected month.
The ``month`` and ``year`` parameters have been undeprecated and can be used to get all
options data for a given month.
If an expiry date that is not valid is given, data for the next expiry after the given
date is returned.
Option data frames are now saved on the instance as ``callsYYMMDD`` or ``putsYYMMDD``. Previously
they were saved as ``callsMMYY`` and ``putsMMYY``. The next expiry is saved as ``calls`` and ``puts``.
New features:
The expiry parameter can now be a single date or a list-like object containing dates.
A new property ``expiry_dates`` was added, which returns all available expiry dates.
current behavior:
.. ipython:: python
from pandas.io.data import Options
aapl = Options('aapl','yahoo')
aapl.get_call_data().iloc[0:5,0:1]
aapl.expiry_dates
aapl.get_near_stock_price(expiry=aapl.expiry_dates[0:3]).iloc[0:5,0:1]
See the Options documentation in :ref:`Remote Data <remote_data.yahoo_options>`
.. _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`)
- Added option to ``Series.str.split()`` to return a ``DataFrame`` rather than a ``Series`` (:issue:`8428`)
- Added option to ``df.info(null_counts=None|True|False)`` to override the default display options and force showing of the null-counts (:issue:`8701`)
.. _whatsnew_0151.performance:
Performance
~~~~~~~~~~~
.. _whatsnew_0151.experimental:
Experimental
~~~~~~~~~~~~
.. _whatsnew_0151.bug_fixes:
Bug Fixes
~~~~~~~~~
- Bug in unpickling of a ``CustomBusinessDay`` object (:issue:`8591`)
- 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 writing Categorical columns to an SQL database with ``to_sql`` (:issue:`8624`).
- Bug in comparing ``Categorical`` of datetime raising when being compared to a scalar datetime (:issue:`8687`)
- Bug in selecting from a ``Categorical`` with ``.iloc`` (:issue:`8623`)
- Bug in groupby-transform with a Categorical (:issue:`8623`)
- Bug in duplicated/drop_duplicates with a Categorical (:issue:`8623`)
- Bug in ``Categorical`` reflected comparison operator raising if the first argument was a numpy array scalar (e.g. np.int64) (:issue:`8658`)
- Bug in Panel indexing with a list-like (:issue:`8710`)
- 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`)
- Bug when doing label based indexing with integers not found in the index for
non-unique but monotonic indexes (:issue:`8680`).
- Bug when indexing a Float64Index with ``np.nan`` on numpy 1.7 (:issue:`8980`).
- 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`)
- Bug in Setting by indexer to a scalar value with a mixed-dtype `Panel4d` was failing (:issue:`8702`)