I am trying to figure out how to see the the data from the zipped content. The scenario is as follows in the code:
import numpy as np
x=[1,2,3]
y=[4,5,6]
z=[7,8,9]
data=np.array(zip(x,y,z))
print (data)
output
array(<zip object at 0x00000166568AE648>, dtype=object)
but i want to see the data inside the zip so when i say
print(data)
it shows
<zip object at 0x00000166568AE648>
now people are discussing in similar posts about D_stacking like..
np.dstack(data)
but it shows the output as a error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-20-2126862e2c70> in <module>()
----> 1 np.dstack(data)
C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\shape_base.py in dstack(tup)
407
408 """
--> 409 return _nx.concatenate([atleast_3d(_m) for _m in tup], 2)
410
411 def _replace_zero_by_x_arrays(sub_arys):
TypeError: iteration over a 0-d array
0 dimension..? what does this mean..? it says the same for other possible solution i found as Decompressing zip
a,b,c=zip(*data)
print('x=',a)
print('y=',b)
print('z=',c)
error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-41-6ad67a911952> in <module>()
----> 1 a,b,c=zip(*data)
2 print('x=',a)
3 print('y=',b)
4 print('z=',c)
TypeError: iteration over a 0-d array
then i went thrugh zip()
function in programiz.com there i found set()
function..
result = set(data)
print (result)
error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-39-2e1af52686b4> in <module>()
----> 1 result = set(data)
2 print (result)
TypeError: iteration over a 0-d array
i believe I'm doing something bad in basic x,y,z data.. but my knowledge is limited to the level of whatever you think about me..
could you please help me with things I'm missing and also explain that lil important point i missed.
When I search for TypeError: iteration over a 0-d array
people talk about json
which I have 0 idea other then FC3, sorry for that.