{"image_url":null,"provider_name":"Hatena Blog","categories":["\u305d\u306e\u4ed6"],"type":"rich","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/misos/","blog_title":"\u3081\u3082","title":"python\u3067np.array(\u4e8c\u6b21\u5143)\u306e\u6700\u5927\u5024\u304c\u3042\u308bindex\u3092\u53d6\u5f97\u3059\u308b\u3002","url":"https://paper.hatenadiary.jp/entry/2016/10/10/165103","blog_url":"https://paper.hatenadiary.jp/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpaper.hatenadiary.jp%2Fentry%2F2016%2F10%2F10%2F165103\" title=\"python\u3067np.array(\u4e8c\u6b21\u5143)\u306e\u6700\u5927\u5024\u304c\u3042\u308bindex\u3092\u53d6\u5f97\u3059\u308b\u3002 - \u3081\u3082\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"\u3084\u308b\u3053\u3068 X = np.array([[1, 2, 3],[4,100, 6]]) \u304b\u3089100\u306eindex\u3067\u3042\u308b (1, 1)\u3092\u53d6\u5f97\u3057\u305f\u3044\u3002 \u89e3\u6c7a\u6cd5 np.argmax\u3092\u4f7f\u3046 np.argmax(X) >> 5 \u3068 \u884c\u5217\u3092\u4e00\u6b21\u5143\u306breshape\u3057\u305f\u6642\u306eindex\u304c\u8fd4\u3063\u3066\u304f\u308b\u3002 np.where\u3092\u4f7f\u3046 zip(np.where(X==X.max())[0], np.where(X==X.max())[1]) >> [(1, 1)] \u3068\u3059\u308c\u3070\u6700\u5927\u5024\u304c\u3042\u308b index\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002","height":"190","author_name":"misos","width":"100%","published":"2016-10-10 16:51:03","version":"1.0"}