ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 24 Feb 2019 20:15:10 -0600Count number of ones in a set of matrixhttp://ask.sagemath.org/question/45540/count-number-of-ones-in-a-set-of-matrix/I am having the following code:
v = MatrixSpace(GF(2),2,2)
c = [0]*2
for vv in v.list():
t=sum(vv)
c = [x+y for x,y in zip(c,t)]
print c
My goal is to count how many '1s' that I have for each column within the set of matrices. For example with the first 4 matrices in the set:
[0 0] [1 0] [0 1] [0 0]
[0 0], [0 0], [0 0], [1 0]
I expect to receive [2,1] as a result, i.e. there are 2 of '1s' appear in the 1st column and 1 of '1s' appears in the 2nd column. However, I got [0, 1], because it's binary base.
Thank you for reading my problem and support :)imnvshSun, 24 Feb 2019 20:15:10 -0600http://ask.sagemath.org/question/45540/frequency (count) in Numpy Arrayhttp://ask.sagemath.org/question/10279/frequency-count-in-numpy-array/Hi experts!
For a list `L` the command `L.count(z)` shows the number of times that the element `z` is repeated in list `L`.
For example:
[I] L=[1,1,3,1,4,5,8]
[I] L.count(1)
[O] 3
How can i do that with a Numpy array?
Waiting for your answers.
Thanks a lot!
mresimulatorTue, 25 Jun 2013 11:28:27 -0500http://ask.sagemath.org/question/10279/loading satoh-fgh in sagehttp://ask.sagemath.org/question/9026/loading-satoh-fgh-in-sage/Does any body know how to use satoh-fgh.gp(point counting algorithm) for characteristic 2 elliptic curves in SAGE?
twoforoneSat, 02 Jun 2012 02:05:35 -0500http://ask.sagemath.org/question/9026/