首页 > 编程语言 >np.clip()的用法和python,numpy中np.random.choice()的用法详解

np.clip()的用法和python,numpy中np.random.choice()的用法详解

时间:2022-10-30 14:23:00浏览次数:73  
标签:clip min 用法 values np numpy

np.clip()的用法

 

numpy.clip(a, a_min, a_max, out=None)

Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

即整个数组的值限制在指定值a_min,与a_max之间,对比a_min小的和比a_max大的值就重置为a_min,和a_max。

python,numpy中np.random.choice()的用法详解

 

 

 

 

标签:clip,min,用法,values,np,numpy
From: https://www.cnblogs.com/wcxia1985/p/16841210.html

相关文章