將不同的數(shù)據類型存儲在一個NumPy數(shù)組中?我有兩個不同的數(shù)組,一個是字符串,另一個是整數(shù)。我想將它們連接到一個數(shù)組中,其中每列都具有原始數(shù)據類型。我目前的解決方案(見下文)將整個數(shù)組轉換為dtype = string,這看起來非常低效。combined_array = np.concatenate((A, B), axis = 1)是否有可能多發(fā)dtypes的combined_array時候A.dtype = string和B.dtype = int?
將不同的數(shù)據類型存儲在一個NumPy數(shù)組中?
catspeake
2019-08-13 16:10:41