ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 13 Dec 2015 14:44:04 +0100How can i counter frequent array in numpy?https://ask.sagemath.org/question/31518/how-can-i-counter-frequent-array-in-numpy/import numpy as np
X=np.array[[1,2], [3,4], [1,2], [4,1]]
"i want to counter repetitive [1,2]"
Sat, 12 Dec 2015 16:25:28 +0100https://ask.sagemath.org/question/31518/how-can-i-counter-frequent-array-in-numpy/Answer by tmonteil for <p>import numpy as np
X=np.array[[1,2], [3,4], [1,2], [4,1]]
"i want to counter repetitive [1,2]"</p>
https://ask.sagemath.org/question/31518/how-can-i-counter-frequent-array-in-numpy/?answer=31548#post-id-31548It is somehow a duplicate of [this question](http://ask.sagemath.org/question/31520/i-am-new-in-python-how-can-i-count-repetetive-array-in-numpy/?answer=31546#post-id-31546), you can change the bi-dimensional numpy array `X` into a list of lists as follows:
sage: Y = [list(x) for x in X]
sage: Y
[[1, 2], [3, 4], [1, 2], [4, 1]]
Sun, 13 Dec 2015 14:44:04 +0100https://ask.sagemath.org/question/31518/how-can-i-counter-frequent-array-in-numpy/?answer=31548#post-id-31548