Quantcast
Channel: bind specific 'Slots' to specific 'Map' - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by kglr for bind specific 'Slots' to specific 'Map'

$
0
0

You can do it even without slots:

Map[Map[Flatten @* List] @* FoldList[List]] @ test  
 {{{4}, {4, 2}, {4, 2, 2}},   {{9}, {9, 1}, {9, 1, 5}},   {{5}, {5, 2}, {5,  2, 9}, {5, 2, 9, 3}},   {{5}, {5, 2}, {5, 2, 7}, {5, 2, 7, 1}, {5, 2, 7, 1, 1}}}

Also

Map[Extract[#, Map[List] @ Range @ Range @ Length @ #] &] @ test  
 {{{4}, {4, 2}, {4, 2, 2}},   {{9}, {9, 1}, {9, 1, 5}},   {{5}, {5, 2}, {5,  2, 9}, {5, 2, 9, 3}},   {{5}, {5, 2}, {5, 2, 7}, {5, 2, 7, 1}, {5, 2, 7, 1, 1}}}

Viewing all articles
Browse latest Browse all 3

Trending Articles



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