w3resource

Pandas DataFrame: ne() function

DataFrame - ne() function

The ne() function returns not equal to of dataframe and other, element-wise.

Among flexible wrappers (eq, ne, le, lt, ge, gt) to comparison operators.

Equivalent to ==, =!, <=, <, >=, > with support to choose axis (rows or columns) and level for comparison.

Syntax:

DataFrame.mul(self, other, axis='columns', level=None, fill_value=None)

Parameters:

Name Description Type/Default Value Required / Optional
other    

Any single or multiple element data structure, or list-like object.

scalar, sequence, Series, or DataFrame Required
axis  Whether to compare by the index (0 or ‘index’) or columns (1 or ‘columns’). {0 or ‘index’, 1 or ‘columns’}
Default Value: ‘columns’
Required
level  Broadcast across a level, matching Index values on the passed MultiIndex level. int or label Required

Returns: DataFrame of bool
Result of the comparison.

Notes:

Mismatched indices will be unioned together. NaN values are considered different (i.e. NaN != NaN).

Example:


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - ge() function
Next: DataFrame - eq() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/pandas/dataframe/dataframe-ne.php