-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
/
Copy pathv0.10.0.txt
145 lines (99 loc) · 4.32 KB
/
v0.10.0.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
.. _whatsnew_0100:
v0.10.0 (December ??, 2012)
---------------------------
This is a major release from 0.9.1 and includes several new features and
enhancements along with a large number of bug fixes.
New features
~~~~~~~~~~~~
Updated PyTables Support
~~~~~~~~~~~~~~~~~~~~~~~~
:ref:`Docs <io-hdf5>` for PyTables ``Table`` format & several enhancements to the api. Here is a taste of what to expect.
.. ipython:: python
:suppress:
:okexcept:
os.remove('store.h5')
.. ipython:: python
store = HDFStore('store.h5')
df = DataFrame(randn(8, 3), index=date_range('1/1/2000', periods=8),
columns=['A', 'B', 'C'])
df
# appending data frames
df1 = df[0:4]
df2 = df[4:]
store.append('df', df1)
store.append('df', df2)
store
# selecting the entire store
store.select('df')
.. ipython:: python
from pandas.io.pytables import Term
wp = Panel(randn(2, 5, 4), items=['Item1', 'Item2'],
major_axis=date_range('1/1/2000', periods=5),
minor_axis=['A', 'B', 'C', 'D'])
wp
# storing a panel
store.append('wp',wp)
# selecting via A QUERY
store.select('wp',
[ Term('major_axis>20000102'), Term('minor_axis', '=', ['A','B']) ])
# removing data from tables
store.remove('wp', [ 'major_axis', '>', wp.major_axis[3] ])
store.select('wp')
# deleting a store
del store['df']
store
**Enhancements**
- added mixed-dtype support!
.. ipython:: python
df['string'] = 'string'
df['int'] = 1
store.append('df',df)
df1 = store.select('df')
df1
df1.get_dtype_counts()
- performance improvments on table writing
- support for arbitrarily indexed dimensions
- ``SparseSeries`` now has a ``density`` property (#2384)
**Bug Fixes**
- added ``Term`` method of specifying where conditions (GH1996_).
- ``del store['df']`` now call ``store.remove('df')`` for store deletion
- deleting of consecutive rows is much faster than before
- ``min_itemsize`` parameter can be specified in table creation to force a minimum size for indexing columns
(the previous implementation would set the column size based on the first append)
- indexing support via ``create_table_index`` (requires PyTables >= 2.3) (GH698_).
- appending on a store would fail if the table was not first created via ``put``
- minor change to select and remove: require a table ONLY if where is also provided (and not None)
.. ipython:: python
:suppress:
store.close()
import os
os.remove('store.h5')
API changes
~~~~~~~~~~~
- ``Series.apply`` will now operate on a returned value from the applied function, that is itself a series, and possibly upcast the result to a DataFrame
.. ipython:: python
def f(x):
return Series([ x, x**2 ], index = ['x', 'x^s'])
s = Series(np.random.rand(5))
s
s.apply(f)
This is conceptually similar to the following.
.. ipython:: python
concat([ f(y) for x, y in s.iteritems() ], axis=1).T
- New API functions for working with pandas options (GH2097_):
- ``get_option`` / ``set_option`` - get/set the value of an option. Partial names are accepted.
- ``reset_option`` - reset one or more options to their default value. Partial names are accepted.
- ``describe_option`` - print a description of one or more options. When called with no arguments. print all registered options.
Note: ``set_printoptions``/ ``reset_printoptions`` are now deprecated (but functioning), the print options now live under "print.XYZ". For example:
.. ipython:: python
import pandas as pd
pd.get_option("print.max_rows")
- to_string() methods now always return unicode strings (GH2224_).
See the `full release notes
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
on GitHub for a complete list.
.. _GH698: https://github.com/pydata/pandas/issues/698
.. _GH1996: https://github.com/pydata/pandas/issues/1996
.. _GH2316: https://github.com/pydata/pandas/issues/2316
.. _GH2097: https://github.com/pydata/pandas/issues/2097
.. _GH2224: https://github.com/pydata/pandas/issues/2224