Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/pandas/core/computation/common.py : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from functools import reduce
3import numpy as np
5from pandas._config import get_option
8def _ensure_decoded(s):
9 """
10 If we have bytes, decode them to unicode.
11 """
12 if isinstance(s, (np.bytes_, bytes)):
13 s = s.decode(get_option("display.encoding"))
14 return s
17def result_type_many(*arrays_and_dtypes):
18 """
19 Wrapper around numpy.result_type which overcomes the NPY_MAXARGS (32)
20 argument limit.
21 """
22 try:
23 return np.result_type(*arrays_and_dtypes)
24 except ValueError:
25 # we have > NPY_MAXARGS terms in our expression
26 return reduce(np.result_type, arrays_and_dtypes)
29class NameResolutionError(NameError):
30 pass