0
グラフラブSFrameから複数の行にアクセスして、それらをnumpy配列に変換しようとしています。Graphlab Sframe、複数の行を取得する
私は96000行と4096列のデータベースfdを持ち、numpy配列に格納されている行番号を取得する必要があります。私が思いついた方法は非常に遅いです。私はそれがすべての反復でsframeのサイズを増やし続けるためだと思うが、私は値を事前割り当てする方法があるかどうかわからない。私は20000行を取得する必要があり、現在のメソッドは終了しません。
fd=fd.add_row_number()
print(indexes)
xs=fd[fd['id'] == indexes[0]] #create the first entry
t=time.time()
for i in indexes[1:]: #Parse through and get indeces
t=time.time()
xtemp=fd[fd['id'] == i]
xs=xs.append(xtemp) #append the new row to the existing sframe
print(time.time()-t)
xs.remove_column('id') #remove the ID Column
print(time.time()-t)
x_sub=xs.to_numpy() #Convert the sframe to numpy