|
15 | 15 | from pandas.core.config import (is_int, is_bool, is_text, is_instance_factory,
|
16 | 16 | is_one_of_factory, get_default_val,
|
17 | 17 | is_callable)
|
18 |
| -from pandas.io.formats.format import detect_console_encoding |
| 18 | +from pandas.io.formats.console import detect_console_encoding |
19 | 19 |
|
| 20 | +# compute |
| 21 | + |
| 22 | +use_bottleneck_doc = """ |
| 23 | +: bool |
| 24 | + Use the bottleneck library to accelerate if it is installed, |
| 25 | + the default is True |
| 26 | + Valid values: False,True |
| 27 | +""" |
| 28 | + |
| 29 | + |
| 30 | +def use_bottleneck_cb(key): |
| 31 | + from pandas.core import nanops |
| 32 | + nanops.set_use_bottleneck(cf.get_option(key)) |
| 33 | + |
| 34 | + |
| 35 | +use_numexpr_doc = """ |
| 36 | +: bool |
| 37 | + Use the numexpr library to accelerate computation if it is installed, |
| 38 | + the default is True |
| 39 | + Valid values: False,True |
| 40 | +""" |
| 41 | + |
| 42 | + |
| 43 | +def use_numexpr_cb(key): |
| 44 | + from pandas.core.computation import expressions |
| 45 | + expressions.set_use_numexpr(cf.get_option(key)) |
| 46 | + |
| 47 | + |
| 48 | +with cf.config_prefix('compute'): |
| 49 | + cf.register_option('use_bottleneck', True, use_bottleneck_doc, |
| 50 | + validator=is_bool, cb=use_bottleneck_cb) |
| 51 | + cf.register_option('use_numexpr', True, use_numexpr_doc, |
| 52 | + validator=is_bool, cb=use_numexpr_cb) |
20 | 53 | #
|
21 | 54 | # options from the "display" namespace
|
22 | 55 |
|
|
0 commit comments