I have a code that will properly return the list of xyz coordinates (or list of xyz coordinates) my problem is that I want to use different numbers directly from those lists, but I can only access the entire list at a time. My code: will return: Now I want to divide it into x and y so x = [2, -2,2] and y = [- 2,0,1]. I have tried to piece it straight, but I get an error about the pieces and not the whole, not the tuples. I also tried to change the numpy using np.hsplit. How can this be achieved? Thanks guys (or girls). edit I know that in these cases it will only be printed at a time, but in my real world example, there are such times Where it will return ([x, y, x], [x, y, z]). Use a list comprehension:
[[[2, -2, 0.2 9]]] [[-2, 0, 1. 9]]] [[[2, 1] , 2.35]]]
gt; & Gt; X = [result [i] [0] [0] i for b]> gt; & Gt; & Gt; Y = [result [i] [0] [1] i for b]> gt; & Gt; & Gt; Print x, y [2, -2, 2] [-2, 0, 1]
No comments:
Post a Comment