【发布时间】:2018-12-18 15:40:55
【问题描述】:
标题 输出:
array(['Subject_ID', 'tube_label', 'sample_#', 'Relabel',
'sample_ID','cortisol_value', 'Group'], dtype='<U14')
身体 输出:
array([['STM002', '170714_STM002_1', 1, 1, 1, 1.98, 'HC'],
['STM002', '170714_STM002_2', 2, 2, 2, 2.44, 'HC'],], dtype=object)
testing = np.concatenate((header, body), axis=0)
ValueError Traceback (most recent call last) <ipython-input-302-efb002602b4b> in <module>()
1 # Merge names and the rest of the data in np array
2
----> 3 testing = np.concatenate((header, body), axis=0)
ValueError: all the input arrays must have same number of dimensions
有人能解决这个问题吗? 我尝试了不同的命令来合并两者(包括堆栈)并且得到相同的错误。尺寸(列)似乎确实相同。
【问题讨论】:
-
你想如何组合这些?它们具有完全不同的形状。 Numpy 不能很好地处理锯齿状数组
标签: python arrays numpy concatenation valueerror