Python Forum
counting the occurence of a specified number in a numpy-matrix - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: Data Science (https://python-forum.io/Forum-Data-Science)
+--- Thread: counting the occurence of a specified number in a numpy-matrix (/Thread-counting-the-occurence-of-a-specified-number-in-a-numpy-matrix)



counting the occurence of a specified number in a numpy-matrix - PhysChem - Apr-03-2019

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?


RE: counting the occurence of a specified number in a numpy-matrix - PhysChem - Apr-03-2019

Oké, it seems, i have a solution. The newer versions of the Spyder IDE support the copy paste.