79126443

Date: 2024-10-25 16:02:25
Score: 2.5
Natty:
Report link
import numpy as np
L=[-1, 3, 4, -2, 6] 
indices=np.array([1, 0, 0, 1,1], dtype=bool)

[None if b else e for e,b in zip(L, indices)]

results in [None, 3, 4, None, None]

is that what you mean?

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Harry Qu