(bytes_array, encoding="utf-8")
| 99 | |
| 100 | |
| 101 | def decode_bytes_array(bytes_array, encoding="utf-8"): |
| 102 | # This is faster than using np.char.decode() or np.vectorize() |
| 103 | bytes_array = np.asarray(bytes_array) |
| 104 | decoded = [x.decode(encoding) for x in bytes_array.ravel()] |
| 105 | return np.array(decoded, dtype=object).reshape(bytes_array.shape) |
| 106 | |
| 107 | |
| 108 | def encode_string_array(string_array, encoding="utf-8"): |
nothing calls this directly
no test coverage detected
searching dependent graphs…