Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

max of 2d array python

>>> numbers = [0, 0, 1, 0, 0, 1], [0, 1, 0, 2, 0, 0], [0, 0, 2, 0, 0, 1], [0, 1, 0, 3, 0, 0], [0, 0, 0, 0, 4, 0]

>>> map(max, numbers)
<map object at 0x0000018E8FA237F0>
>>> list(map(max, numbers))  # max numbers from each sublist
[1, 2, 2, 3, 4]

>>> max(map(max, numbers))  # max of those max-numbers
4
Comment

find max value in 2d array python

a = [1, 2, 3, 4, 5]
print(max(a))
# 5
Comment

PREVIOUS NEXT
Code Example
Python :: dopleganger 
Python :: make python look good 
Python :: serving static audio files with flask in react 
Python :: runner up score through recurssion 
Python :: Simulate webcam and microphone selenium 
Python :: how to close python with a line of code 
Python :: convert dtype of column cudf 
Python :: function python to get the minimu and its position 
Python :: add colour to text in python 
Python :: is prime python 
Python :: python program to convert tuple into string 
Python :: get current time python django 
Python :: multiline input in python 
Python :: pandas create new column 
Python :: undefie int value python 
Python :: wonsan 
Python :: `12` print () 
Python :: how to extract words from sentence in python 
Python :: numpy identity matrix 
Python :: pypi toml 
Python :: python last element in list 
Python :: python prayer time 
Python :: datetime python 
Python :: python record screen 
Python :: numpy distance between two points 
Python :: how to use python to open camera app using python 
Python :: how to give multiple option to the user and ask the same question again and again until the user tells one of the options 
Python :: django q filter 
Python :: csv python write 
Python :: none address in python 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =