Lance Ruo Zhang
Lance Ruo Zhang

Reputation: 401

What is the meaning of vertical bar in array dtype ('|S58')

I have an error when I tried to do

np.savetxt(f, te_filename)

It returns an error of

% (str(X.dtype), format))

TypeError: Mismatch between array dtype ('|S58') and format specifier ('%.18e')

I checked the doc page,

https://docs.scipy.org/doc/numpy-1.10.0/reference/arrays.dtypes.html

Seems that S stands for string and 58 is the length, what is the meaning of vertical bar then?

Upvotes: 6

Views: 1201

Answers (1)

user2357112
user2357112

Reputation: 280207

It's a byte order specifier, specifying "byte orders don't apply".

  • '=': native
  • '<': little-endian
  • '>': big-endian
  • '|': not applicable

Upvotes: 8

Related Questions