ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 13 Dec 2015 07:44:04 -0600How can i counter frequent array in numpy?http://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 09:25:28 -0600http://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>
http://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 07:44:04 -0600http://ask.sagemath.org/question/31518/how-can-i-counter-frequent-array-in-numpy/?answer=31548#post-id-31548