I have some data files that contain boolean output from Fortran code:
write(23,'(L2)') data
therefore, a portion of the file will look like this:
F F T F ...
I would like to read this file in Python with numpy.asarray() function, because it is easy to convert data this way, e.g.:
data = asarray(f.readline().split(),'bool')
However, no matter what data it is, Python always returns an array with all 'True's.
I have also tried to write as 'False False True False ...' or '0 0 1 0 ...', and they both did not work.
I would like to know if there is a way to use asarray() to achieve this? or any other suggestions that can convert boolean data without using loops?