Horje
numpy replace Code Example
numpy replace
import numpy as np
array1 = np.array([2, 2, 2, 0, 2, 0, 2])
print(np.where(array1==0, 1, array1))
# OUTPUT = [2 2 2 1 2 1 2]
Source: www.kite.com




Python

Related
odoo - add one2many field programmatically Code Example odoo - add one2many field programmatically Code Example
what is a rare earth Code Example what is a rare earth Code Example
airflow set ui color of operator ui_color Code Example airflow set ui color of operator ui_color Code Example
replicate python Code Example replicate python Code Example
if elif and else in python Code Example if elif and else in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7