Search⌘ K
AI Features

Logical Operators with Pandas Series

Explore logical operators in Pandas Series and understand how to handle NaN values and other special floating-point cases. Learn practical techniques to identify and work with missing data, enhancing your data manipulation and problem-solving skills using Pandas.

We'll cover the following...

Try it yourself

Try executing the code below to see the result.

Python 3.8
import numpy as np
import pandas as pd
s = pd.Series([1, np.nan, 3])
print(s[~(s == np.nan)])

Explanation

We covered some floating-point oddities in the “Multiplying” puzzle. The NaN (or np.nan) ...