>>> from io import StringIO
>>> import numpy as np
>>> s = StringIO("1,1.3,abcde")
>>> data = np.genfromtxt(s, dtype=[('myint','i8'),('myfloat','f8'),
... ('mystring','S5')], delimiter=",")
>>> data
array((1, 1.3, 'abcde'),
dtype=[('myint', '<i8'), ('myfloat', '<f8'), ('mystring', '|S5')])
My question is related to dtype
argument.
I am unable to understand what dtype="i8,f8,|S5"
stands for.
I can make out that i is an integer,f is the float and s is the string but what is 8 in i8? I first understood it for bytes but how can then s5 be possible.
I understand that dtype helps to specify the data type so that we can read from CSV file but can someone give some insight on data types