<p><strong>让我们想象一下(你会永远记得),</strong>
<a href="https://i.stack.imgur.com/FzimB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FzimB.png" alt="enter image description here"/></a></p>
<p>在熊猫中:</p>
<ol>
<li>轴=0表示沿“索引”。这是一个按行操作。</li>
</ol>
<p>假设,要对dataframe1&dataframe2执行concat()操作,
我们将从dataframe1中取出第一行并放入新的DF中,然后从dataframe1中取出另一行并放入新的DF中,重复此过程,直到到达dataframe1的底部。然后,我们对dataframe2执行相同的过程。</p>
<p>基本上,将dataframe2堆叠在dataframe1之上,反之亦然。</p>
<p><strong>例如在桌子或地板上堆一堆书</strong></p>
<ol start=“2”>
<li>轴=1表示沿“列”。这是一个按列操作。</strong></li>
</ol>
<p>假设,要对dataframe1&dataframe2执行concat()操作,
我们将取出dataframe1的第1列complete column(亦称第1列),放入新的DF中,然后取出dataframe1的第2列,并保持与之相邻<strong>(侧向)</strong>,我们必须重复此操作,直到所有列都完成为止。然后,在dataframe2上重复相同的过程。
基本上,
<strong>横向堆叠数据帧2。</strong></p>
<p><strong>例如在书架上安排书籍。</strong></p>
<blockquote>
<p>More to it, since arrays are better representations to represent a nested n-dimensional structure compared to matrices! so below can help you more to visualize how axis plays an important role when you generalize to more than one dimension. Also, you can actually print/write/draw/visualize any n-dim array but, writing or visualizing the same in a matrix representation(3-dim) is impossible on a paper more than 3-dimensions. </p>
</blockquote>
<p><a href="https://i.stack.imgur.com/waS00.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/waS00.jpg" alt="enter image description here"/></a></p>