一
- pandas.DataFrame.drop
DataFrame.drop(labels, axis=0, level=None, inplace=False, errors='raise')
labels : single label or list-like
axis : int or axis name
level : int or level name, default None
inplace : bool, default False
If True, do operation inplace and return None.
errors : {‘ignore’, ‘raise’}, default ‘raise’
If ‘ignore’, suppress error and existing labels are dropped.
axis
用于指定行或者列,0为行,1为列inplace
为false
的时候,仅仅对视图做修改,内存不变。为true
的时候,对应的内存直接被修改,此时返回值为None
- 当
inplace
为false
时,该函数为其他变量赋值,变量得到其删除后的内容。