Re: [personal kdb+] dictionary with flip

as you point out, tables are stored in memory as a flipped dictionary of lists:

show t:flip nameiq!(DentBeeblebrox`Prefect;98 42 126)
name       iq

Dent       98
Beeblebrox 42
Prefect    126

but you can treat a table as a list of dictionaries (and index them by row):

q)t 0
name| `Dent
iq  | 98

the resulting dictionary has atomic values and flipping it does not create a ‘flipped dictionary of lists’.

q)flip t 0
'rank
  [0]  flip t 0

one option is to turn each of the dictionary values into a list before flipping it:

q)flip enlist each t 0
name iq

Dent 98

another option is to generate a list of conforming dictionaries.  q will then coerce them back into a table.  in this example, the list only has one element (a dictionary), but it would work for many more (as long as they all have the same column names and the columns appear in the same order).

q)enlist t 0
name iq

Dent 98

this is typically the desired behavior.  but if you actually wanted a list of dictionaries,  you are out of luck:

q)(t 0;t 0)
name iq

Dent 98
Dent 98
q)t 0 0
name iq

Dent 98
Dent 98

Thanks Nick

Thanks Alexander