I am working with a large simulation code and am having a hard time executing some iteration. I have imported data of size 262144 from a text file and reshaped into a (64,64,64) set as such
filename = path + 'density'
file = open(filename, mode='rb')
bin_array = array.array('f')
bin_array.fromfile(file, 64 * 64 * 64)
rho = np.reshape(bin_array, (64,64,64))
This is then stored in self.data as:
self.data = [rho]
and accessed using self.data[0][x,y,z]. According to the manual for the code I'm working with, each value in rho needs to be a float of 4 bytes. Now when I run other working examples (call the data for this 'good_data'), the data used gives the following output for isinstance:
isinstance(good_data, float)
>> True
Now when I use isinstance on rho, it returns false and I believe this is whats giving me problems. Can anyone tell me how I can have my data return true for isinstance? Essentially what I want is
isinstance(rho[x,y,z], float)
>> True
When I check the dtype it returns float32 but returns false for isinstance. Thank you all!