why append make 3D array?

Viewed 43

I'm trying to append the images to features but the append , it's append addition thing like counter

the data array is images with labels -> data = [img, label]

    data=np.zeros([10,2])


# data array is like that [img , label]

X=[] #array of images -> should be 2D but append make it 3D
y=[] # the label #it's work great 1D just label

    for features, label in data:
            X.append(features)
            print('** ', np.shape(X))
            y.append(label)

output/run :

data shape -> (10, 2)

and this is X shape after appending

it's append one more dimensional like that (1, . (2, (3, , ... ,

** (1,) ** (2,) ** (3,) ** (4,) ** (5,) ** (6,) ** (7,) ** (8,) ** (9,) ** (10,)

I don't want this additional dimensional because it gives problems with image shape

0 Answers
Related