Top "Flatten" questions

Flattening refers to either reducing a multi-dimensional array to a single dimension or to reducing a class and class methods to handle based function calls.

Un-optioning an optioned Option

Say I have a val s: Option[Option[String]]. It can thus have the following values: Some(Some("foo")) Some(…

scala join option monads flatten
How can I "merge", "flatten" or "pivot" results from a query which returns multiple rows into a single result?

I have a simple query over a table, which returns results like the following: id id_type id_ref 2702 5 31 2702 16 14 2702 17 3 2702 40 1 2703 23 4 2703 23 5 2703 34 6 2704 1 14 And …

sql sybase pivot flatten
Flatten nested JSON using jq

I'd like to flatten a nested json object, e.g. {"a":{"b":1}} to {"a.b":1} in order to digest it …

json elasticsearch solr jq flatten
PHP Laravel 5.5 collections flatten and keep the integer keys?

I have the following array : $array = [ '2' => ['3' => ['56' => '2'], '6' => […

php laravel flatten collect
3D array (1D flat) indexing

I am using a coordinate system x (width), y (height), z (Depth) Just to clear confusion if there is any …

java arrays multidimensional-array 3d flatten
Flatten complex directory structure in Python

I want to move files from a complex directory structure to just one place. For example i have this deep …

python directory-structure flatten file-move
Python 3 replacement for deprecated compiler.ast flatten function

What's the recommended way to flatten nested lists since the deprecation of the compiler package? >>> from compiler.…

python python-3.x flatten
How can I flatten an array swiftily in Swift?

I want to turn this: let x = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] into this: [1, 2, 3, 4, 5, 6, 7, 8, 9] very gracefully. The most straightforward way, of course, is var y = […

arrays swift flatten
SQL Server : flatten results from One to Many query

OK, I have a system where orders get entered, and each order can have any number of bond, job and …

sql sql-server sql-server-2008 one-to-many flatten
lxml - get a flat list of elements

I'd like to flatten an lxml etree (specifically, HTML, if it matters.) How would I go about getting a flat …

python dom tree lxml flatten