Tag Info

New answers tagged

2

ArrayPad does precisely what you want, nevertheless I'd suggest one more solution without calling a special function, which I think a little clearer than the original with Drop and PadRight: Join[list[[m + 1 ;;]], Table[list[[-1]], {m}]]


5

I may be back to using gedanken Mathematica, but I'm confident this works: m = 2; ArrayPad[{3, 8, 2, 7, 1, 6}, {-m, m}, "Fixed"] {2, 7, 1, 6, 6, 6}


5

The introduction of Assocation brings a powerful new way to handle this problem. Version 10.2 provides for import of JSON as nested associations without use of ToAssociations by using the format "RawJSON".   (* archive data *) ad = {"accept_rate" -> 75, "account_id" -> 395497, "age" -> 41, "badge_counts" -> {"bronze" -> 35, ...



Top 50 recent answers are included