Python Question

# Fastest way to calculate "cosine" metrcis with scipy

Iam given matrix of ones and zeros. I need to find 20 rows which have the highest cosine metrics towards 1

specific
row in matrix:
if I have 10 rows, and 5th is called
specific
i want to choose the highest value between these:
cosine(1row,5row),cosine(2row,5row),...,cosine(8row,5row),cosine(9row,5row)

First, i tried to count metrics.
This didnt work:

A = ratings[:,100]
A = A.reshape(1,A.shape[0])
B = ratings.transpose()
similarity = -cosine(A,B)+1
A.shape = (1L, 71869L)
B.shape = (10000L, 71869L)

Error is:
Input vector should be 1-D.
I'd like to know, how to implement this with estetical beuty and no errors, but the most important - which solution will be the fastest?
In my opinion, the fastest way is not realized with help of
scipy
:
We just have to take all ones in
specific
row and look at these indexes in all other rows. Those rows, which have the highest coincidence will have the highest matrix. Are there any faster ways?