Quantcast
Channel: User Graygood - Stack Overflow
Viewing all articles
Browse latest Browse all 32

Split list according to the rule

$
0
0

I have a list

values_list = [1013.0, 683.0, 336.0, 406.0, 636.0, 1065.0, 1160.0]

Also I have a value

value = 660.6153846153846

This list is based on the assumption that there are 3 stages. First stage should be higher that the value, second - lower, and third is again higher.

I want to split this list into three lists, saving the order of the values like this:

values_list = [[1013.0, 683.0], [336.0, 406.0, 636.0], [1065.0, 1160.0]]

Viewing all articles
Browse latest Browse all 32

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>