Register for our webinar

### How to Nail your next Technical Interview

1 hour
1
Enter details
2
Select webinar slot
*Invalid First Name
*Invalid Last Name
*Invalid Phone Number
Step 1
Step 2
Congratulations!
You have registered for our webinar
Oops! Something went wrong while submitting the form.
1
Enter details
2
Select webinar slot
Step 1
Step 2
Confirmed
You are scheduled with Interview Kickstart.
Redirecting...
Oops! Something went wrong while submitting the form.

## You may be missing out on a 66.5% salary hike*

### Nick Camilleri

Head of Career Skills Development & Coaching
*Based on past data of successful IK students
Help us know you better!

## How many years of coding experience do you have?

Oops! Something went wrong while submitting the form.

### Attend our Free Webinar on How to Nail Your Next Technical Interview

WEBINAR +LIVE Q&A

## How To Nail Your Next Tech Interview

Hosted By
Ryan Valles
Founder, Interview Kickstart
Our tried & tested strategy for cracking interviews
How FAANG hiring process works
The 4 areas you must prepare for
How you can accelerate your learnings

# Numpy where() in Python

### Attend our Free Webinar on How to Nail Your Next Technical Interview

WEBINAR +LIVE Q&A

## How To Nail Your Next Tech Interview

Hosted By
Ryan Valles
Founder, Interview Kickstart
Our tried & tested strategy for cracking interviews
How FAANG hiring process works
The 4 areas you must prepare for
How you can accelerate your learnings

# Numpy where() in Python

# Introduction to Numpy Where in Python Numpy is a fundamental library for scientific computing in Python. It provides high-performance multi-dimensional array objects and functions for manipulating these arrays. Numpy Where is an in-built function that is used to return the indices of elements in an input array where the given condition is satisfied. The Where function returns a tuple of arrays, one for each dimension of the array, containing the indices of the elements that satisfy the condition. The condition can be a boolean array, or a single boolean condition. The Numpy Where function can be used to create boolean arrays and filter the elements of an array based on conditions. It can also be used to modify elements in an array based on conditions. In addition, the Where function can be used to select elements from one array based on conditions in another array. This makes it a powerful and versatile tool for data analysis. In this article, we will discuss the Numpy Where function and its various applications. We will also look at some examples of the Where function in action.

## Worried About Failing Tech Interviews?

Attend our webinar on
"How to nail your next tech interview" and learn

Hosted By
Ryan Valles
Founder, Interview Kickstart
Our tried & tested strategy for cracking interviews
How FAANG hiring process works
The 4 areas you must prepare for
How you can accelerate your learnings
Numpy's `where()` function is a useful tool for returning the indices of elements in an array that satisfy a given condition. It is similar to a `for` loop, but instead of looping over the elements and performing a comparison, it returns the indices that satisfy the comparison. Syntax: ``` np.where(condition) ``` Example: ```python import numpy as np arr = np.array([10, 20, 30, 40, 50]) result = np.where(arr > 25) print(result) ``` Output: `(array([2, 3, 4]),)`