I have the output from Python wavelet package:
[[[[[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...,
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...,
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...,
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
...,
[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...,
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...,
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]
[[255 255 255 255]
[255 255 255 255]
[255 255 255 255]
...,
[255 255 255 255]
[255 255 255 255]
[255 255 255 255]]]]]]
I need to print it to terminal and to a .csv
file in one line with tab separation and without brackets.
def waveletdbbiorone(self): #function for Wavelets computation
for filename in glob.iglob ('*.tif'):
imgwbior = mahotas.imread (filename) #read the image
arraywbior = numpy.array([imgwbior])#make an array for pywt module
coefwbior = pywt.wavedec(arraywbior,'db1')#compute wavelet coefficients
arr = numpy.array([coefwbior])
np.set_printoptions(precision=3)
print arr