Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
レコードの最初の要素と最後の要素の差が最大になるレコードを見つけたいと思っています。
誰かがこれを行う方法を提案できますか?
設定:
import numpy ra = numpy.recarray((10,), 'int,int,int')
最初のフィールドと最後のフィールドの差の最大値のインデックスを見つけます。
idx = numpy.argmax(ra['f0']-ra['f2'])
そのインデックスを使用してレコードを取得します
print ra[idx]