<bdo id='tI21s'></bdo><ul id='tI21s'></ul>
  • <i id='tI21s'><tr id='tI21s'><dt id='tI21s'><q id='tI21s'><span id='tI21s'><b id='tI21s'><form id='tI21s'><ins id='tI21s'></ins><ul id='tI21s'></ul><sub id='tI21s'></sub></form><legend id='tI21s'></legend><bdo id='tI21s'><pre id='tI21s'><center id='tI21s'></center></pre></bdo></b><th id='tI21s'></th></span></q></dt></tr></i><div id='tI21s'><tfoot id='tI21s'></tfoot><dl id='tI21s'><fieldset id='tI21s'></fieldset></dl></div>

        <tfoot id='tI21s'></tfoot>

      1. <legend id='tI21s'><style id='tI21s'><dir id='tI21s'><q id='tI21s'></q></dir></style></legend>

        <small id='tI21s'></small><noframes id='tI21s'>

        用矩阵 B 附加矩阵 A

        Appending matrix A with matrix B(用矩阵 B 附加矩阵 A)
      2. <i id='mDGC5'><tr id='mDGC5'><dt id='mDGC5'><q id='mDGC5'><span id='mDGC5'><b id='mDGC5'><form id='mDGC5'><ins id='mDGC5'></ins><ul id='mDGC5'></ul><sub id='mDGC5'></sub></form><legend id='mDGC5'></legend><bdo id='mDGC5'><pre id='mDGC5'><center id='mDGC5'></center></pre></bdo></b><th id='mDGC5'></th></span></q></dt></tr></i><div id='mDGC5'><tfoot id='mDGC5'></tfoot><dl id='mDGC5'><fieldset id='mDGC5'></fieldset></dl></div>

            <bdo id='mDGC5'></bdo><ul id='mDGC5'></ul>

            <tfoot id='mDGC5'></tfoot>

            <small id='mDGC5'></small><noframes id='mDGC5'>

            <legend id='mDGC5'><style id='mDGC5'><dir id='mDGC5'><q id='mDGC5'></q></dir></style></legend>

                    <tbody id='mDGC5'></tbody>

                • 本文介绍了用矩阵 B 附加矩阵 A的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  假设我有两个矩阵 AB.例如,

                  Say I have two matrices A and B. For example,

                  A = numpy.zeros((5,5))
                  
                  B = np.eye(5)
                  

                  有没有办法追加AB?

                  推荐答案

                  听起来你在寻找 np.hstack:

                  >>> import numpy as np
                  >>> a = np.zeros((5, 5))
                  >>> b = np.eye(5)
                  >>> np.hstack((a, b))
                  array([[ 0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.]])
                  

                  np.vstack 如果您想将它们向下堆叠,则可以使用:

                  np.vstack will work if you want to stack them downward:

                  >>> np.vstack((a, b))
                  array([[ 0.,  0.,  0.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.],
                         [ 0.,  0.,  0.,  0.,  0.],
                         [ 1.,  0.,  0.,  0.,  0.],
                         [ 0.,  1.,  0.,  0.,  0.],
                         [ 0.,  0.,  1.,  0.,  0.],
                         [ 0.,  0.,  0.,  1.,  0.],
                         [ 0.,  0.,  0.,  0.,  1.]])
                  

                  这篇关于用矩阵 B 附加矩阵 A的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                    <tfoot id='o7A7e'></tfoot>

                    <small id='o7A7e'></small><noframes id='o7A7e'>

                  • <i id='o7A7e'><tr id='o7A7e'><dt id='o7A7e'><q id='o7A7e'><span id='o7A7e'><b id='o7A7e'><form id='o7A7e'><ins id='o7A7e'></ins><ul id='o7A7e'></ul><sub id='o7A7e'></sub></form><legend id='o7A7e'></legend><bdo id='o7A7e'><pre id='o7A7e'><center id='o7A7e'></center></pre></bdo></b><th id='o7A7e'></th></span></q></dt></tr></i><div id='o7A7e'><tfoot id='o7A7e'></tfoot><dl id='o7A7e'><fieldset id='o7A7e'></fieldset></dl></div>
                    <legend id='o7A7e'><style id='o7A7e'><dir id='o7A7e'><q id='o7A7e'></q></dir></style></legend>
                        • <bdo id='o7A7e'></bdo><ul id='o7A7e'></ul>
                              <tbody id='o7A7e'></tbody>