Python Forum
Finding all maximum values in a matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding all maximum values in a matrix
#3
Thank you very much for your reply.

Yes, something like that, except that I am trying to find maximum values over every cell (or grid) within the matrix (called variable "Quantity") for every year for 40 years. This is what I have so far:

Quantity=Q
Count=0

for i in Quantity:
Count=Count+1

print(max(Quantity))


I receive an error when running that, stating: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). I guess my code is erroneous?
Reply


Messages In This Thread
RE: Finding all maximum values in a matrix - by Lightning1800 - May-11-2018, 08:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if two matrix are equal and of not add the matrix to the list quest 3 778 Jul-10-2023, 02:41 AM
Last Post: deanhystad
  Moving data from one Excel to another and finding maximum profit azizrasul 7 1,411 Oct-06-2022, 06:13 PM
Last Post: azizrasul
  How to multiply a matrix with herself, until the zero matrix results peanutbutterandjelly 3 3,300 May-03-2021, 06:30 AM
Last Post: Gribouillis
  finding element of specific field in pandas adjacency matrix amjass12 0 1,640 Oct-27-2020, 09:27 AM
Last Post: amjass12
  Finding Max and Min Values Associated with Unique Identifiers in Python ubk046 1 2,007 May-08-2020, 12:04 PM
Last Post: anbu23
  Finding and indexing maximum value BlueBall 2 2,308 Oct-25-2018, 09:14 AM
Last Post: perfringo
  finding 2 max values in an array in python Akankshha 11 169,275 Oct-18-2018, 09:16 AM
Last Post: perfringo
  Need help for finding cumulative values in a loop Lightning1800 10 6,008 May-23-2018, 07:48 PM
Last Post: Lightning1800
  Finding values to draw a line on a curve kesenthilkumar 2 3,486 Sep-19-2017, 09:50 AM
Last Post: kesenthilkumar
  matrix from matrix python numpy array shei7141 1 3,642 Jan-16-2017, 06:10 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020