numpy array数组如何找出最大,最小?
(array([[[ 704, 627]], [[ 703, 628]],
[[ 692, 628]],
[[ 691, 629]],
[[ 686, 629]],
[[ 685, 630]],
[[ 678, 630]],
[[ 677, 631]],
[[ 664, 631]],
[[ 663, 632]],
[[ 653, 632]],
[[ 652, 633]],
[[ 649, 633]],
[[ 648, 634]],
[[ 645, 634]],
[[ 644, 635]],
[[ 639, 635]],
[[ 638, 636]],
[[ 905, 741]],
[[ 906, 740]],
[[ 911, 740]],
[[ 912, 739]],
[[ 914, 739]],
[[ 915, 738]],
[[ 917, 738]],
[[ 918, 737]],
[[ 922, 737]],
[[ 923, 736]],
[[ 930, 736]],
[[ 931, 735]],
[[ 936, 735]],
[[ 937, 734]],
[[ 938, 734]],
[[ 941, 731]],
[[ 942, 731]],
[[ 943, 730]],
[[ 944, 730]],
[[ 945, 729]],
[[ 949, 729]],
[[ 950, 728]],
[[ 956, 728]],
[[ 957, 727]],
[[ 960, 727]],
[[ 961, 726]],
[[ 963, 726]],
[[ 964, 725]],
[[ 965, 725]],
[[ 966, 724]],
[[ 970, 724]],
[[ 971, 723]],
[[ 979, 723]],
[[ 980, 722]],
[[ 985, 722]],
[[ 986, 721]],
[[ 987, 721]],
[[ 988, 720]],
[[ 988, 718]],
[[ 990, 716]],
[[ 992, 716]],
[[ 993, 715]],
[[ 999, 715]],
[[1000, 714]],
[[1006, 714]],
[[1007, 713]],
[[1011, 713]],
[[1012, 712]],
[[1013, 712]],
[[1015, 710]],
[[1017, 710]],
[[1018, 709]],
[[1020, 709]],
[[1021, 708]],
[[1024, 708]],
[[1025, 707]],
[[1029, 707]],
[[1030, 706]],
[[1032, 706]],
[[1033, 705]],
[[1034, 705]],
[[1035, 704]],
[[1036, 704]],
[[1036, 702]],
[[1037, 701]],
[[1037, 699]],
[[1038, 698]],
[[1041, 698]],
[[1042, 697]],
[[1047, 697]],
[[1048, 696]],
[[1055, 696]],
[[1056, 695]],
[[1059, 695]],
[[1060, 694]],
[[1060, 692]],
[[1061, 691]],
[[1061, 689]],
[[1062, 688]],
[[1062, 687]],
[[1064, 685]],
[[1067, 685]],
[[1068, 684]],
[[ 735, 628]],
[[ 734, 627]]], dtype=int32),)
numpy array数组如何找出最大,最小?
[X,Y]
比如
找出 最小的 X
最小 X
[ 100, 0]
最大 X
[ 999, 0]
最小 Y
[ 0, 100]
最大 Y
[ 0, 999]
回答:
分别取出这两列然后max就行max(array[:,0])
max(array[:,-1])
以上是 numpy array数组如何找出最大,最小? 的全部内容, 来源链接: utcz.com/p/938596.html