<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>misos</author_name>
  <author_url>https://blog.hatena.ne.jp/misos/</author_url>
  <blog_title>めも</blog_title>
  <blog_url>https://paper.hatenadiary.jp/</blog_url>
  <categories>
    <anon>その他</anon>
  </categories>
  <description>やること X = np.array([[1, 2, 3],[4,100, 6]]) から100のindexである (1, 1)を取得したい。 解決法 np.argmaxを使う np.argmax(X) &gt;&gt; 5 と 行列を一次元にreshapeした時のindexが返ってくる。 np.whereを使う zip(np.where(X==X.max())[0], np.where(X==X.max())[1]) &gt;&gt; [(1, 1)] とすれば最大値がある indexが取得できる。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpaper.hatenadiary.jp%2Fentry%2F2016%2F10%2F10%2F165103&quot; title=&quot;pythonでnp.array(二次元)の最大値があるindexを取得する。 - めも&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-10-10 16:51:03</published>
  <title>pythonでnp.array(二次元)の最大値があるindexを取得する。</title>
  <type>rich</type>
  <url>https://paper.hatenadiary.jp/entry/2016/10/10/165103</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
