How can I split a list of integers based on specific value? See following example for instance:
inp = [1, 3, 4, 5, -999, 0, 0, 1, 3, 5, -999, 85, 82, 84]
outs = magic_function(inp)
>> [[1,3,4,5], [0,0,1,3,5], [85,82,84]] # expected output is like this
The output will be a list of list which splited based on -999. So far I handle it with for-loop or convert it to string and then use str.split('-999')
but I would like to know is there any elegant (more efficient) way to do this?