コードを書いている途中どうしても解決しないエラーがあって困っています。
整数の配列だけが~~というのはわかるのですがどう解決すればいいかわかりません。
お手数ですが教えていただきたいです。
使用しているのはpython3.6,参考にしたコードは2.xかもしれません。
*追記
_indexesがint型ではない配列になっているのでreturn action[_indexes[0]]において変換に関するエラーを吐いていると考えています。
とすると_indexesの配列をどうやってint型に変換すればいいのかが分かりません。
python
1def __select_greedy_action(self, action): 2 y, x = self.state 3 _max = self.q[action, y, x].max() 4 _indexes = list(numpy.argwhere(self.q[action, y, x] == _max)) 5 random.shuffle(_indexes) 6 return action[_indexes[0]] 7 8エラー内容 9 return action[_indexes[0]] 10 11TypeError: only integer scalar arrays can be converted to a scalar index