且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从多个列表中找到最大值?

更新时间:2022-02-11 08:57:10

使用 :

numpy.maximum(x1, x2[, out])
数组的按元素最大值 元素.

numpy.maximum(x1, x2[, out])
Element-wise maximum of array elements.

比较两个数组,并返回一个新的包含按元素排列的数组 最大值.如果要比较的元素之一是nan,则表示 元素被返回.如果两个元素都是nans,那么第一个是 回来.后一种区分对于复杂的Nans很重要, 被定义为至少一个实部或虚部是 南最终的结果是,NAN得以传播.

Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a nan, then that element is returned. If both elements are nans then the first is returned. The latter distinction is important for complex nans, which are defined as at least one of the real or imaginary parts being a nan. The net effect is that nans are propagated.