![]() Finally, the most nested lists have 4 elements each, same as the third dimension of a (depth/# of colors). Each of these elements is itself a list with 3 elements, which is equal to the second dimension of a (# of columns). The first level of this compound list l has exactly 2 elements, just as the first dimension of the array a (# of rows). Let's look at a full example: > a = np.zeros((2, 3, 4))Īrrays in NumPy are printed as the word array followed by structure, similar to embedded Python lists. You have a truncated array representation. Have I misunderstood something? If not, why the heck is numpy using such a unintuitive way of working with 3D-dimensional arrays? This complicates things greatly if all I want to do is try something on a known smaller 3-dimensional array. To further add to this problem, importing an image with OpenCV the color dimension is the last dimension, that is, I see the color information as the depth dimension. That is, the first dimension is the "depth". That is, 3 rows, 4 column and 2 depth dimensions. ![]() Instead it is presented as [0 0 0 0 [0 0 0 0 In my world this should result in 2 rows, 3 columns and 4 depth dimensions and it should be presented as: [0 0 0 [0 0 0 [0 0 0 [0 0 0 In fact the order doesn't make sense at all. My problem is that the order of the dimensions are off compared to Matlab. New at Python and Numpy, trying to create 3-dimensional arrays. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |