NumPy where

  • Post category:NumPy

In this NumPy tutorial, you’ll learn how to use the NumPy where function in Python.

Python

Output:

[11 22 33 44 55]
(array([2, 3, 4], dtype=int64),)
(array([0, 1], dtype=int64),)
(array([2, 3, 4], dtype=int64),)
(array([0, 1], dtype=int64),)
(array([], dtype=int64),)
(array([0, 1, 2, 3, 4], dtype=int64),)

Free resources to learn advanced skills: AiHints and CodeAllow