IA has to tell which elements to take from A; it does so by using position
IA[i] to give the index in A of the first non-zero element in row i of A,
hence row i of the matrix contains elements A[IA[i]:IA[i+1]], each one
located at column [J[IA[j]] for j in range(IA[i], IA[i+1])]. So A and JA
will always have the same length and IA will always be of length = rows +
1, starting with 0 and ending with len(A). Consider

0, 0, 0
0, 2, 3
4, 0, 0

A = [2, 3, 4]
JA = [1, 2, 0], the col of each non-zero element
IA = [0, 0, 2, 3] because row 0 contains elements IA[0:0] = null elements,
row 1 contains IA[0:2] = [2, 3] and row 2 contains elements IA[2:3] = [4]

group is just used to count how many elements are in a given row so the
starting index for each row can be calculated.