该函数为数组中的每个元素调用 str.encode函数,默认编码为utf_8,可以使用标准Python库中可用的编解码器。
import numpy as np a=np.char.encode('hello', 'cp500') print a
其输出如下-
链接:https://www.learnfk.comhttps://www.learnfk.com/numpy/numpy-char-encode.html
来源:LearnFk无涯教程网
�����
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)