npcscan怎么清除缓存,haose,手机模拟器安卓版
# -*- coding: utf-8 -*- """ python version: 3.5 created on thu may 11 14:42:49 2017 e-mail: eric2014_lv@sjtu.edu.cn @author: didilv """ import numpy as np a = np.array([[1,2], [3, 4], [5, 6]]) # 寻找元素大于2的值,并且返回其bool值 bool_idx = (a > 2) # find the elements of a that are bigger than 2; # this returns a numpy array of booleans of the same # shape as a, where each slot of bool_idx tells # whether that element of a is > 2. print(bool_idx) # prints "[[false false] # [ true true] # [ true true]]" # we use boolean array indexing to construct a rank 1 array # consisting of the elements of a corresponding to the true values # of bool_idx print(a[bool_idx]) # prints "[3 4 5 6]" # we can do all of the above in a single concise statement: print(a[a > 2]+10) # prints "[13 14 15 16]"
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
新手学习Python2和Python3中print不同的用法
Python基于os.environ从windows获取环境变量
网友评论