Skip to content

Commit 64c2eb6

Browse files
committed
Merge branch 'master' of git://github.com/pydata/pandas into pytablesv4
2 parents a4191c6 + 7f32698 commit 64c2eb6

24 files changed

+1442
-221
lines changed

.travis.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ python:
77
- 3.2
88

99
install:
10-
- pip install --use-mirrors cython numpy nose pytz python-dateutil
10+
- export PYTHONIOENCODING=utf8 # activate venv 1.8.4 "detach" fix
11+
- virtualenv --version
12+
- whoami
13+
- pwd
14+
# install 1.7.0b2 for 3.3, and pull a version of numpy git master
15+
# with a alternate fix for detach bug as a temporary workaround
16+
# for the others.
17+
- "if [ $TRAVIS_PYTHON_VERSION == '3.3' ]; then pip uninstall numpy; pip install http://downloads.sourceforge.net/project/numpy/NumPy/1.7.0b2/numpy-1.7.0b2.tar.gz; fi"
18+
- "if [ $TRAVIS_PYTHON_VERSION == '3.2' ] || [ $TRAVIS_PYTHON_VERSION == '3.1' ]; then pip install --use-mirrors git+git://github.com/numpy/numpy.git@089bfa5865cd39e2b40099755e8563d8f0d04f5f#egg=numpy; fi"
19+
- "if [ ${TRAVIS_PYTHON_VERSION:0:1} == '2' ]; then pip install numpy; fi" # should be nop if pre-installed
20+
- pip install --use-mirrors cython nose pytz python-dateutil
1121

1222
script:
1323
- python setup.py build_ext install

doc/source/groupby.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,15 @@ The dimension of the returned result can also change:
560560

561561
In [11]: grouped.apply(f)
562562

563+
``apply`` on a Series can operate on a returned value from the applied function, that is itself a series, and possibly upcast the result to a DataFrame
564+
565+
.. ipython:: python
566+
567+
def f(x):
568+
return Series([ x, x**2 ], index = ['x', 'x^s'])
569+
s = Series(np.random.rand(5))
570+
s
571+
s.apply(f)
563572
564573
Other useful features
565574
---------------------

doc/source/v0.10.0.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.. _whatsnew_0100:
2+
3+
v0.10.0 (December ??, 2012)
4+
---------------------------
5+
6+
This is a major release from 0.9.1 and includes several new features and
7+
enhancements along with a large number of bug fixes.
8+
9+
New features
10+
~~~~~~~~~~~~
11+
12+
13+
API changes
14+
~~~~~~~~~~~
15+
16+
- ``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
17+
18+
.. ipython:: python
19+
20+
def f(x):
21+
return Series([ x, x**2 ], index = ['x', 'x^s'])
22+
s = Series(np.random.rand(5))
23+
s
24+
s.apply(f)
25+
26+
This is conceptually similar to the following.
27+
28+
.. ipython:: python
29+
30+
concat([ f(y) for x, y in s.iteritems() ], axis=1).T
31+
32+
- New API functions for working with pandas options (GH2097_):
33+
34+
- ``get_option`` / ``set_option`` - get/set the value of an option.
35+
- ``reset_option`` / ``reset_options`` - reset an options / all options to their default value.
36+
- ``describe_options`` - print a description of one or more option. When called with no arguments. print all registered options.
37+
- ``set_printoptions`` is now deprecated (but functioning), the print options now live under "print_config.XYZ". For example:
38+
39+
40+
.. ipython:: python
41+
42+
import pandas as pd
43+
pd.get_option("print_config.max_rows")
44+
45+
See the `full release notes
46+
<https://github.com/pydata/pandas/blob/master/RELEASE.rst>`__ or issue tracker
47+
on GitHub for a complete list.
48+
49+
.. _GH2316: https://github.com/pydata/pandas/issues/2316
50+
.. _GH2097: https://github.com/pydata/pandas/issues/2097

doc/source/whatsnew.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ What's New
1616

1717
These are new features and improvements of note in each release.
1818

19+
.. include:: v0.10.0.txt
20+
1921
.. include:: v0.9.1.txt
2022

2123
.. include:: v0.9.0.txt

pandas/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
from pandas.version import version as __version__
2323
from pandas.info import __doc__
2424

25+
# let init-time option registration happen
26+
import pandas.core.config_init
27+
2528
from pandas.core.api import *
2629
from pandas.sparse.api import *
2730
from pandas.stats.api import *

pandas/core/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@
2929
# legacy
3030
from pandas.core.daterange import DateRange # deprecated
3131
import pandas.core.datetools as datetools
32+
33+
from pandas.core.config import get_option,set_option,reset_option,\
34+
reset_options,describe_options

pandas/core/common.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
from pandas.util.py3compat import StringIO, BytesIO
2121

22+
from pandas.core.config import get_option
23+
2224
# XXX: HACK for NumPy 1.5.1 to suppress warnings
2325
try:
2426
np.seterr(all='ignore')
@@ -1113,7 +1115,7 @@ def in_interactive_session():
11131115
# 2) If you need to send something to the console, use console_encode().
11141116
#
11151117
# console_encode() should (hopefully) choose the right encoding for you
1116-
# based on the encoding set in fmt.print_config.encoding.
1118+
# based on the encoding set in option "print_config.encoding"
11171119
#
11181120
# 3) if you need to write something out to file, use
11191121
# pprint_thing_encoded(encoding).
@@ -1165,16 +1167,17 @@ def pprint_thing(thing, _nest_lvl=0):
11651167
result - unicode object on py2, str on py3. Always Unicode.
11661168
11671169
"""
1168-
from pandas.core.format import print_config
1170+
11691171
if thing is None:
11701172
result = ''
11711173
elif (py3compat.PY3 and hasattr(thing,'__next__')) or \
11721174
hasattr(thing,'next'):
11731175
return unicode(thing)
11741176
elif (isinstance(thing, dict) and
1175-
_nest_lvl < print_config.pprint_nest_depth):
1177+
_nest_lvl < get_option("print_config.pprint_nest_depth")):
11761178
result = _pprint_dict(thing, _nest_lvl)
1177-
elif _is_sequence(thing) and _nest_lvl < print_config.pprint_nest_depth:
1179+
elif _is_sequence(thing) and _nest_lvl < \
1180+
get_option("print_config.pprint_nest_depth"):
11781181
result = _pprint_seq(thing, _nest_lvl)
11791182
else:
11801183
# when used internally in the package, everything
@@ -1202,12 +1205,12 @@ def pprint_thing_encoded(object, encoding='utf-8', errors='replace'):
12021205

12031206

12041207
def console_encode(object):
1205-
from pandas.core.format import print_config
12061208
"""
12071209
this is the sanctioned way to prepare something for
12081210
sending *to the console*, it delegates to pprint_thing() to get
12091211
a unicode representation of the object relies on the global encoding
12101212
set in print_config.encoding. Use this everywhere
12111213
where you output to the console.
12121214
"""
1213-
return pprint_thing_encoded(object, print_config.encoding)
1215+
return pprint_thing_encoded(object,
1216+
get_option("print_config.encoding"))

0 commit comments

Comments
 (0)