pandas 1.4.2

ParametersReturnsBackRef
dropna(self, axis=0, inplace=False, how=None)

See the User Guide <missing_data> for more on which values are considered missing, and how to work with missing data.

Parameters

axis : {0 or 'index'}, default 0

There is only one axis to drop values from.

inplace : bool, default False

If True, do operation inplace and return None.

how : str, optional

Not in use. Kept for compatibility.

Returns

Series or None

Series with NA entries dropped from it or None if inplace=True .

Return a new Series with missing values removed.

See Also

DataFrame.dropna

Drop rows or columns which contain NA values.

Index.dropna

Drop missing indices.

Series.fillna

Replace missing values.

Series.isna

Indicate missing values.

Series.notna

Indicate existing (non-missing) values.

Examples

This example is valid syntax, but we were not able to check execution
>>> ser = pd.Series([1., 2., np.nan])
... ser 0 1.0 1 2.0 2 NaN dtype: float64

Drop NA values from a Series.

This example is valid syntax, but we were not able to check execution
>>> ser.dropna()
0    1.0
1    2.0
dtype: float64

Keep the Series with valid entries in the same variable.

This example is valid syntax, but we were not able to check execution
>>> ser.dropna(inplace=True)
... ser 0 1.0 1 2.0 dtype: float64

Empty strings are not considered NA values. None is considered an NA value.

This example is valid syntax, but we were not able to check execution
>>> ser = pd.Series([np.NaN, 2, pd.NaT, '', None, 'I stay'])
... ser 0 NaN 1 2 2 NaT 3 4 None 5 I stay dtype: object
This example is valid syntax, but we were not able to check execution
>>> ser.dropna()
1         2
3
5    I stay
dtype: object
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.series.Series.isnull pandas.core.series.Series.notnull pandas.core.series.Series.groupby pandas.core.series.Series.drop pandas.core.series.Series.isna pandas.core.frame.DataFrame.dropna pandas.core.series.Series.notna

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/series.py#5301
type: <class 'function'>
Commit: