MCPcopy
hub / github.com/pandas-dev/pandas / ensure_decoded

Function ensure_decoded

pandas/core/computation/common.py:10–16  ·  view source on GitHub ↗

If we have bytes, decode them to unicode.

(s)

Source from the content-addressed store, hash-verified

8
9
10def ensure_decoded(s) -> str:
11 """
12 If we have bytes, decode them to unicode.
13 """
14 if isinstance(s, (np.bytes_, bytes)):
15 s = s.decode(get_option("display.encoding"))
16 return s
17
18
19def result_type_many(*arrays_and_dtypes):

Callers 2

convert_valueMethod · 0.90
convert_valuesMethod · 0.90

Calls 2

get_optionFunction · 0.90
decodeMethod · 0.80

Tested by

no test coverage detected