I am trying to compute the z-score of a ndarray (1x119) and put the results into a new one. But I got the 'The truth value of an array with more than one element is ambiguous' error.
Here's the code:
data = loadmat('data.mat') // return us a dict
ts_1 = data['exp1']
ts_2 = data['exp2']
ts_all = np.concatenate(ts_1,ts_2, axis=1)
ts_all = np.array(ts_all) // useless?
ts_all_z = np.zeros(ts_all.shape)
for i in range(ts_all.shape[1]):
ts_all_z[:,i] = stats.zscore(ts_all[:,i]) // error
I don't understand because I am not doing any boolean comparison...am I?
When looking at ts_all with np.info we get:
class: ndarray shape: (1, 119) strides: (952, 8) itemsize: 8 aligned: True contiguous: True fortran: True data pointer: 0x13b243030 byteorder: little byteswap: False type: object None
Also, ts_1 and 2 are ndarray of shape (1,22) and (1,24) respectively, of strides (8,8) both.
I think the concatenation is not done correctly? Or the iteration through ts_all shouldn't be done with .shape ...?
Thanks in advance.