<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] # 每個數組排序 ~~~ import numpy as np tang_array = np.array([[1.5, 1.3, 7.5], [5.6, 7.8, 1.2]]) sort = np.sort(tang_array) print(sort) ~~~ 輸出 ~~~ [[ 1.3 1.5 7.5] [ 1.2 5.6 7.8]] ~~~ # 按照維度排序 ~~~ import numpy as np tang_array = np.array([[1.5, 1.3, 7.5], [5.6, 7.8, 1.2]]) sort = np.sort(tang_array, axis=0) print(sort) ~~~ 輸出 ~~~ [[ 1.5 1.3 1.2] [ 5.6 7.8 7.5]] ~~~ **指定不同維度不同排序** ~~~ import numpy as np tang_array = np.array([[1, 0, 6], [1, 7, 0], [2, 3, 1], [2, 4, 0]]) # 先按第2列升序(tang_array[:, 2]),然后按照第0列降序,滿足前面條件下,再滿足后面的 index = np.lexsort([-1 * tang_array[:, 0], tang_array[:, 2]]) # 得到索引 print(index) # 根據索引得到結果 print(tang_array[index]) ~~~ 輸出 ~~~ [3 1 2 0] [[2 4 0] [1 7 0] [2 3 1] [1 0 6]] ~~~ # 打印排序的索引 ~~~ import numpy as np tang_array = np.array([[1.5, 1.3, 7.5], [5.6, 7.8, 1.2]]) print(tang_array) argsort = np.argsort(tang_array) print(argsort) ~~~ 輸出 ~~~ [[ 1.5 1.3 7.5] [ 5.6 7.8 1.2]] [[1 0 2] [2 0 1]] ~~~ # 查詢插入的位置 ~~~ import numpy as np # 按照一個平均差異構造十個數(0到10) tang_array = np.linspace(0, 10, 10) print(tang_array) # 準備把這些元素插入進去 values = np.array([2.5, 6.5, 9.5]) # 查詢插入的位置,要求是排好序的結果 searchsorted = np.searchsorted(tang_array, values) print(searchsorted) ~~~ 返回 ~~~ [ 0. 1.11111111 2.22222222 3.33333333 4.44444444 5.55555556 6.66666667 7.77777778 8.88888889 10. ] [3 6 9] ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看