Skip to main content
edited body
Source Link
brienna
  • 1.1k
  • 5
  • 13

It is ordered. I need to split this list into 1., 2., 3. segments based on the first element of each sublist, removing any segments that are smaller than that, e.g. 1., 2.. I want to end up with something like this: {{{1., 1812.}, {2., 10076.}}, {{3., 4762.}}, {{1., 4262.}, {2., 5059.}, {3., 5860.}}}

It is ordered. I need to split this list into 1., 2., 3. segments based on the first element of each sublist, removing any segments that are smaller than that, e.g. 1., 2.. I want to end up with something like this: {{{1., 1812.}, {2., 10076.}}, {{3., 4762.}, {1., 4262.}, {2., 5059.}, {3., 5860.}}}

It is ordered. I need to split this list into 1., 2., 3. segments based on the first element of each sublist, removing any segments that are smaller than that, e.g. 1., 2.. I want to end up with something like this: {{{1., 1812.}, {2., 10076.}, {3., 4762.}}, {{1., 4262.}, {2., 5059.}, {3., 5860.}}}

edited tags
Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Tweeted twitter.com/StackMma/status/1011542280849764352
added 309 characters in body
Source Link
brienna
  • 1.1k
  • 5
  • 13

Another idea for partitioning the list is to split it on the 1.'s. I tried this with Split[list, (#2 =!= {1}) &] but it doesn't quite work. I don't have the syntax correct.

Another idea for partitioning the list is to split it on the 1.'s. I tried this with Split[list, (#2 =!= {1}) &] but it doesn't quite work. I don't have the syntax correct.

added 224 characters in body
Source Link
brienna
  • 1.1k
  • 5
  • 13
Loading
Source Link
brienna
  • 1.1k
  • 5
  • 13
Loading