该函数为数组中的每个元素调用 str.encode函数,默认编码为utf_8,可以使用标准Python库中可用的编解码器。
import numpy as np a=np.char.encode('hello', 'cp500') print a
其输出如下-
�����
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
Spring Cloud 微服务项目实战 -〔姚秋辰(姚半仙)〕