MCPcopy
hub / github.com/pydata/xarray / decode

Method decode

xarray/coding/strings.py:90–98  ·  view source on GitHub ↗
(self, variable: Variable, name=None)

Source from the content-addressed store, hash-verified

88 return variable
89
90 def decode(self, variable: Variable, name=None) -> Variable:
91 dims, data, attrs, encoding = unpack_for_decoding(variable)
92
93 if "_Encoding" in attrs:
94 string_encoding = pop_to(attrs, encoding, "_Encoding")
95 func = partial(decode_bytes_array, encoding=string_encoding)
96 data = lazy_elemwise_func(data, func, np.dtype(object))
97
98 return Variable(dims, data, attrs, encoding)
99
100
101def decode_bytes_array(bytes_array, encoding="utf-8"):

Callers 3

decode_bytes_arrayFunction · 0.45

Calls 5

VariableClass · 0.90
unpack_for_decodingFunction · 0.85
pop_toFunction · 0.85
lazy_elemwise_funcFunction · 0.85
dtypeMethod · 0.45