```
a = [[1.], [-1.], [1.]]

```

I have the above list. I want to find the value: (# of -1)/length of a. For the above example, the value is 1/3.

If we have

```
a = [[1.], [-1.], [1.], [-1.]]

```

then the value is 1/2.

How can I perform the above calculation in Python?

I've tried `a.count(-1)/a.shape[0]`, but that did not seem to work for list objects.