如何在python中比较ndarrays

时间:2015-10-25 19:42:39

标签: python

我有一个像

这样的ndarray数组
array([ ndarray[ 3,  2,  1], ndarray [ 2,  4,  5], ndarray[ 1 ,  3,  6]])

我想找到ndarrays之间的第1,第2和第3单元格中的最大值:

Result = [3,4,6]

(3 array[0][0]array[1][0]array[2][0]之间的最大值

怎么做?

1 个答案:

答案 0 :(得分:0)

您可以在轴0上使用 internal static string testStringForNumber(string v) { // example: string strToTest = Data.CommonMethods.testStringForNumber(this.amountTextBox.Text.Trim()); string returnValue = ""; string chr = ""; int nLen = v.Length; int i = 0; // this is my counter while (i < nLen) { chr = v.Substring(i, 1); switch (chr) { case ".": returnValue = returnValue + chr; break; case "0": returnValue = returnValue + chr; break; case "9": returnValue = returnValue + chr; break; case "8": returnValue = returnValue + chr; break; case "7": returnValue = returnValue + chr; break; case "6": returnValue = returnValue + chr; break; case "5": returnValue = returnValue + chr; break; case "4": returnValue = returnValue + chr; break; case "3": returnValue = returnValue + chr; break; case "2": returnValue = returnValue + chr; break; case "1": returnValue = returnValue + chr; break; } i = i + 1; } return returnValue; }

numpy.max