np.clip()的用法

一時間忘了,就又看了一下API。是這樣說的

numpy.clip(aa_mina_maxout=None)[source]

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.

也就是說,截取的意思,超出的部分就把它強置爲邊界部分。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章