MCPcopy Index your code
hub / github.com/pydata/xarray / encode_string_array

Function encode_string_array

xarray/coding/strings.py:108–111  ·  view source on GitHub ↗
(string_array, encoding="utf-8")

Source from the content-addressed store, hash-verified

106
107
108def encode_string_array(string_array, encoding="utf-8"):
109 string_array = np.asarray(string_array)
110 encoded = [x.encode(encoding) for x in string_array.ravel()]
111 return np.array(encoded, dtype=bytes).reshape(string_array.shape)
112
113
114def ensure_fixed_length_bytes(var: Variable) -> Variable:

Callers 1

encodeMethod · 0.85

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…