forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
v0.7.3.txt
96 lines (67 loc) · 3.06 KB
/
v0.7.3.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
.. _whatsnew_0703:
v.0.7.3 (April 12, 2012)
------------------------
This is a minor release from 0.7.2 and fixes many minor bugs and adds a number
of nice new features. There are also a couple of API changes to note; these
should not affect very many users, and we are inclined to call them "bug fixes"
even though they do constitute a change in behavior. See the `full release
notes <https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue
tracker on GitHub for a complete list.
New features
~~~~~~~~~~~~
- New :ref:`fixed width file reader <io.fwf>`, ``read_fwf``
- New :ref:`scatter_matrix <visualization.scatter_matrix>` function for making
a scatter plot matrix
.. code-block:: python
from pandas.tools.plotting import scatter_matrix
scatter_matrix(df, alpha=0.2)
.. image:: _static/scatter_matrix_ex.png
:width: 5in
- Add ``stacked`` argument to Series and DataFrame's ``plot`` method for
:ref:`stacked bar plots <visualization.barplot>`.
.. code-block:: python
df.plot(kind='bar', stacked=True)
.. image:: _static/bar_plot_stacked_ex.png
:width: 4in
.. code-block:: python
df.plot(kind='barh', stacked=True)
.. image:: _static/barh_plot_stacked_ex.png
:width: 4in
- Add log x and y :ref:`scaling options <visualization.basic>` to
``DataFrame.plot`` and ``Series.plot``
- Add ``kurt`` methods to Series and DataFrame for computing kurtosis
NA Boolean Comparison API Change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reverted some changes to how NA values (represented typically as ``NaN`` or
``None``) are handled in non-numeric Series:
.. ipython:: python
series = Series(['Steve', np.nan, 'Joe'])
series == 'Steve'
series != 'Steve'
In comparisons, NA / NaN will always come through as ``False`` except with
``!=`` which is ``True``. *Be very careful* with boolean arithmetic, especially
negation, in the presence of NA data. You may wish to add an explicit NA
filter into boolean array operations if you are worried about this:
.. ipython:: python
mask = series == 'Steve'
series[mask & series.notnull()]
While propagating NA in comparisons may seem like the right behavior to some
users (and you could argue on purely technical grounds that this is the right
thing to do), the evaluation was made that propagating NA everywhere, including
in numerical arrays, would cause a large amount of problems for users. Thus, a
"practicality beats purity" approach was taken. This issue may be revisited at
some point in the future.
Other API Changes
~~~~~~~~~~~~~~~~~
When calling ``apply`` on a grouped Series, the return value will also be a
Series, to be more consistent with the ``groupby`` behavior with DataFrame:
.. ipython:: python
df = DataFrame({'A' : ['foo', 'bar', 'foo', 'bar',
'foo', 'bar', 'foo', 'foo'],
'B' : ['one', 'one', 'two', 'three',
'two', 'two', 'one', 'three'],
'C' : np.random.randn(8), 'D' : np.random.randn(8)})
df
grouped = df.groupby('A')['C']
grouped.describe()
grouped.apply(lambda x: x.order()[-2:]) # top 2 values