8 results · AI-generated index
N
numpy.org
official

NumPy: Replace Values in 2D Array Based on Condition

Use numpy.where() to replace values in a 2D array based on a condition. This function allows you to specify a condition and replacement values.

S
stackoverflow.com
article

Replace Values in 2D NumPy Array

You can use numpy.where() or boolean indexing to replace values in a 2D NumPy array based on a condition. Example code is provided.

R
realpython.com
article

Conditional Replacement in NumPy Arrays

Learn how to replace values in NumPy arrays based on conditions using numpy.where(), numpy.putmask(), and boolean indexing.

P
python.org
official

NumPy Array Operations

The official Python documentation provides an overview of NumPy array operations, including conditional replacement using numpy.where().

T
towardsdatascience.com
article

Replacing Values in 2D Arrays with NumPy

This article provides a step-by-step guide on replacing values in 2D NumPy arrays based on conditions, including example use cases.

S
scipy-lectures.org
research

Conditional Array Operations

This lecture note covers conditional array operations in NumPy, including replacing values based on conditions using numpy.where() and numpy.select().

D
datacamp.com
tool

NumPy Tutorial: Conditional Replacement

This tutorial provides interactive examples and exercises on replacing values in NumPy arrays based on conditions, including 2D arrays.

Y
youtube.com
video

Replace Values in 2D NumPy Array Based on Condition

This video tutorial demonstrates how to replace values in a 2D NumPy array based on a condition using numpy.where() and boolean indexing.