{"id":995,"date":"2013-05-03T20:09:28","date_gmt":"2013-05-03T20:09:28","guid":{"rendered":"http:\/\/garysieling.com\/blog\/?p=995"},"modified":"2013-05-03T20:09:28","modified_gmt":"2013-05-03T20:09:28","slug":"scala-zipall-example","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/scala-zipall-example\/","title":{"rendered":"Scala zipAll Example"},"content":{"rendered":"<p>The zip function combines two lists into tuples. If the lists are of differing lengths, the shorter length is used. If you don&#8217;t like this behavior, the zipAll function will keep all elements, filling in specified values for the blanks (compare this to the recycling rule in R, which lets you continuously cycle through the shorter list).<\/p>\n<pre lang=\"Java\">\nval a = List(\"a\", \"b\", \"c\", \"d\")\nval b = List(1, 2, 3);\n\nprintln(a.zipAll(b, \"for missing values\", 100))\n<\/pre>\n<p>And here is the output for each:<\/p>\n<pre>\nList((a,1), (b,2), (c,3))\nList((a,1), (b,2), (c,3), (d,100))\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The zip function combines two lists into tuples. If the lists are of differing lengths, the shorter length is used. If you don&#8217;t like this behavior, the zipAll function will keep all elements, filling in specified values for the blanks (compare this to the recycling rule in R, which lets you continuously cycle through the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/scala-zipall-example\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Scala zipAll Example&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[244,300,440,480],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/995"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=995"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/995\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}