当axis=1时,数组的变化是横向的,而体现出来的是列的增加或者减少。简称之为横向堆叠。
当axis=0时,数组的变化是纵向的,而体现出来的是行的增加或者减少。简称之为纵向堆叠。
以下以table1为例
比如 table1.isnull().sum(axis=0)方法,当axis=0时纵向堆叠
运算前
column1 | column2 | column3 | column4 | |
---|---|---|---|---|
row1 | 1 | 2 | 3 | 4 |
row2 | 1 | 2 | 4 |
运算后
column1 | column2 | column3 | column4 | |
---|---|---|---|---|
0 | 0 | 1 | 0 |
比如 table1.drop([‘column4’],axis=1),当axis&#