最初に何をしたいかを示しましょう。
私は私が欲しいのは、アレイ内で繰り返される数字の位置を選択し、マトリックスにx_newどこにそれを印刷することで、AttributeError: 'numpy.int32'オブジェクトに属性 'append'がありません
x = [1, 2, 1, 2, 3, 3, 2, 3, 1, 2]
を行列を持つ:
x_new[0]= [0,2,8] (for similar position of repeated 1's in x)
x_new[1]=[1,3,6,9](for similar position of repeated 2's in x)
x_new[2]=[4,5,7] (for similar position of repeated 3's in x)
今まで、私がやっていること
a=[]
x=m[:,3] #x=np.array([1, 2, 1, 2, 3, 3, 2, 3, 1, 2])
ss=set([i for i in x if sum([1 for a in x if a == i]) > 1])
lenss=len(ss)
for ln in range(lenss):
for k in range(10):
if(x[k]== list(ss)[ln]):
print k
a.append(ln)
print 'next'
しかしa.appendラインでそれを示しています::ある
'numpy.int32'オブジェクトには属性 'append'がありません
誰でもこのエラーを解決する方法を教えてください。 のPython 2.xのに感謝
申し訳ありません...あなたを手に入れました。私にチェックさせてください。ありがとうたくさん –