mindspore2022/docs/api/api_python/dataset/mindspore.dataset.text.to_b...

11 lines
447 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.. py:method:: mindspore.dataset.text.to_bytes(array, encoding='utf8')
基于 `encoding` 字符集对每个元素进行编码,将 `string` 的NumPy数组转换为 `bytes` 的数组。
**参数:**
- **array** (numpy.ndarray) - 表示 `string` 类型的数组,代表字符串。
- **encoding** (str) - 表示用于编码的字符集。
**返回:**
numpy.ndarray表示 `bytes` 的NumPy数组。