Can someone help me to wrap my head around numpy?
In the following code I expect that col1 would give me an array of shape (2, 3) just as the expected_arr. But apparently col1 seems to have shape (2,). I suppose that means it's an array with two tupels (instead of an array with two arrays with 3 values each.
import numpy as np
import random
from collections import deque
vals = np.array([
[[1, 2, 3], False],
[[4, 5, 6], False]
])
col1 = vals[:,0]
print(col1)
print(col1.shape)
expected_arr = np.array([[1, 2, 3], [4, 5, 6]])
print(expected_arr)
print(expected_arr.shape)
So, what I want is, given a structure of vals, I'd like to get the first column so that the output is an array of shape (2,3).
Can someone help me out here?