"""
Return object with labels in given axis omitted where alternately any
Or all of the data is missing
Parameters
----------
Axis: {0 or ' index ', 1 or ' columns '}, or tuple/list thereof
Pass tuple or list to drop on multiple axes
How: {"Any", ' all '}
* Any:if any NA values is present, drop that label
* All:if All values is NA, drop that label
Thresh:int, default None
int value:require that many non-na values
Subset:array-like
Labels along other axis to consider, e.g. if is dropping rows
These would is a list of columns to include
Inplace:boolean, default False
If True, do Operation InPlace and return None.
Returns
-------
Dropped:dataframe
Examples
--------
>>> df = PD. DataFrame ([[Np.nan, 2, Np.nan, 0], [3, 4, Np.nan, 1],
... [Np.nan, Np.nan, Np.nan, 5]],
... columns=list (' ABCD '))
>>> DF
A B C D
0 Nan 2.0 nan 0
1 3.0 4.0 NaN 1
2 Nan Nan nan 5
Drop the columns where all elements is Nan:
>>> Df.dropna (Axis=1, how= ' all ')
A B D
0 NaN 2.0 0
1 3.0 4.0 1
2 Nan nan 5
Drop the columns where any of the elements is Nan
>>> Df.dropna (Axis=1, how= ' any ')
D
0 0
1 1
2 5
Drop the rows where all of the elements is Nan
(There is no row-to-drop, so DF stays the same):
>>> Df.dropna (axis=0, how= ' all ')
A B C D
0 Nan 2.0 nan 0
1 3.0 4.0 NaN 1
2 Nan Nan nan 5
Keep only the rows with at least 2 Non-na values:
>>> Df.dropna (thresh=2)
A B C D
0 Nan 2.0 nan 0
1 3.0 4.0 NaN 1
"""
Usage of Python Dropna