For example:

```
a=[-15,-30,-10,1,3,5]
```

I want to find a negative and a positive minimum.

```
example: negative
print(min(a)) = -30
positive
print(min(a)) = 1
```

+1 vote

For example:

```
a=[-15,-30,-10,1,3,5]
```

I want to find a negative and a positive minimum.

```
example: negative
print(min(a)) = -30
positive
print(min(a)) = 1
```

...

This does not return a negative minimum on input [1] (because there is none).

min([e for e in a if e >=0]

This does not return a positive minimum on input [0] (because there is none).

I would have said:

pos_min = min(e for e in a if e > 0)

neg_min = min(e for e in a if e < 0)

And then deal with the ValueError when there is no such minimum, as appropriate.