Reference/flip

From Kx Wiki
Revision as of 08:52, 28 October 2009 by Chris Burke (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

flip (flip function)

flip transposes its argument, which may be a list of lists, a dictionary or a table.

Syntax

q)R:flip M

Example

q)flip (1 2 3;4 5 6)
1 4
2 5
3 6

Dictionaries and Tables

If D is a dictionary where the keys are a list of symbols, and where the values are conformable lists (i.e. have the same length or are atoms), then flip applied to D will return a table. The flip of a table is a dictionary.

Example

q)D:`sym`price`size!(`IBM`MSFT;10.2 23.45;100 100)
q)flip D
sym  price size
---------------
IBM  10.2  100
MSFT 23.45 100
q)D~flip flip D
1b

For a complete list of functions, see the kdb+ Function Reference.

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox