数组dtype('|S58')中竖线的含义是什么 [英] What is the meaning of vertical bar in array dtype ('|S58')
本文介绍了数组dtype('|S58')中竖线的含义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试执行时出错
np.savetxt(f, te_filename)
它返回一个错误
% (str(X.dtype), format))
TypeError: 数组 dtype ('|S58') 和格式说明符 ('%.18e') 不匹配
TypeError: Mismatch between array dtype ('|S58') and format specifier ('%.18e')
我检查了文档页面,
https://docs.scipy.org/doc/numpy-1.10.0/reference/arrays.dtypes.html
好像S代表字符串,58是长度,那竖线是什么意思?
Seems that S stands for string and 58 is the length, what is the meaning of vertical bar then?
推荐答案
这是一个 字节顺序说明符,指定字节顺序不适用".
It's a byte order specifier, specifying "byte orders don't apply".
- '=': 原生
- '<':小端
- '>':大端
- '|':不适用
这篇关于数组dtype('|S58')中竖线的含义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文