Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
Disabled
×
Change Orientation
import numpy as np arr = np.array([41, 42, 43, 44]) # Create an empty list filter_arr = [] # go through each element in arr for element in arr: # if the element is higher than 42, set the value to True, otherwise False: if element > 42: filter_arr.append(True) else: filter_arr.append(False) newarr = arr[filter_arr] print(filter_arr) print(newarr)
[False, False, True, True]
[43 44]
×
Report a Problem:
Your E-mail:
Page address:
Description:
Disabled