I have a 40\*4 matrix`M` and a vector`A` with 40 elements. I want to calculate the cosine distance between `A` and each column vector in M.

Do I really need to write like this?

```
 print [cosine(M[:,i],A) for i in range(A.shape[1])]

```

Or there's another better way to do this?

The document of cosine can be viewed here: <http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.cosine.html#scipy.spatial.distance.cosine>

Thanks!