Python Forum
counting the occurence of a specified number in a numpy-matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
counting the occurence of a specified number in a numpy-matrix
#1
Hi!
There is a numpy-matrix with a couple column and about 100000 row. For now, only the last element of each row is important.
I wish to count, that how many row has the number 1 as the last element. Then how many row has the number 2 as the last element, and so on (until the number 1000). It would be also good, if i could count, how many row has greater then 1000 as the last element.

Is there any solution for this problem (without to write a code with tausends of lines)?

Or is there any way, to copy past the values of a matrix from Spyder IDE to Libreoffice Calc?
Reply
#2
Oké, it seems, i have a solution. The newer versions of the Spyder IDE support the copy paste.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 303 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,530 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  convert 'A B C' to numpy float matrix rezabma 4 2,491 Feb-27-2020, 09:48 AM
Last Post: rezabma
  Add column to numpy matrix Gigux 1 4,408 Aug-02-2019, 12:05 AM
Last Post: scidam
  Python/C API Matrix to Numpy jibarra 0 1,854 Jul-29-2019, 03:25 PM
Last Post: jibarra
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,934 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  Creating matrix counting words in list of strings jazmad 2 3,505 Dec-23-2018, 05:47 PM
Last Post: jazmad
  Numpy random number Bryant 1 4,448 Jul-23-2017, 11:14 PM
Last Post: MTVDNA

Forum Jump:

User Panel Messages

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