0
のインデックスを作成する際に、私は次のコード行列の行をソートして、別のベクトルから対応する要素を選択するために実行している:エラーnumpyの配列
import pandas as pd
import numpy as np
# compute ids
coeff = np.dot(matrix1, np.transpose(matrix2))
print coeff.shape, ids.shape
indices = coeff.argsort()[:, ::-1]
print indices.shape
coeff_idx = ids[indices]
をしかし、プログラムがになったとき、私はエラーを取得します最後の行:
(11396, 45582) (11396,)
(11396, 45582)
...
File "pandas/hashtable.pyx", line 359, in pandas.hashtable.Int64HashTable.lookup (pandas/hashtable.c:7427)
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)