SaltyCrane Blog — Notes on JavaScript and web development

Tabular data structure conversion in Python

Please see my updated post at:

/blog/2007/12/tabular-data-structure-conversion-in-python/

You should be redirected in 2 seconds.

The table below lists all the conversions available between the 8 types of tabular data structures. The function names link to the function definition below.

  TO
  lorl
list of lists
where each inner list is a row
locl
list of lists
where each inner list is a column
lord
list of dicts
where each dict is a row
locd
list of dicts
where each dict is a column
dorl
dict of lists
where each list is a row
docl
dict of lists
where each list is a column
dord
dict of lists
where each inner dict is a row
docd
dict of lists
where each inner dict is a column
F
R
O
M
lorl
list of lists
where each inner list is a row
lorl2
locl()
lorl2
lord()
lorl2
locd()
lorl2
dorl()
lorl2
docl()
lorl2
dord()
lorl2
docd()
locl
list of lists
where each inner list is a column
locl2
lorl()
locl2
lord()
locl2
locd()
locl2
dorl()
locl2
docl()
locl2
dord()
locl2
docd()
lord
list of dicts
where each dict is a row
lord2
lorl()
lord2
locl()
lord2
locd()
lord2
dorl()
lord2
docl()
lord2
dord()
lord2
docd()
locd
list of dicts
where each dict is a column
locd2
lorl()
locd2
locl()
locd2
lord()
locd2
dorl()
locd2
docl()
locd2
dord()
locd2
docd()
dorl
dict of lists
where each list is a row
dorl2
lorl()
dorl2
locl()
dorl2
lord()
dorl2
locd()
dorl2
docl()
dorl2
dord()
dorl2
docd()
docl
dict of lists
where each list is a column
docl2
lorl()
docl2
locl()
docl2
lord()
docl2
locd()
docl2
dorl()
docl2
dord()
docl2
docd()
dord
dict of dicts
where each inner dict is a row
dord2
lorl()
dord2
locl()
dord2
lord()
dord2
locd()
dord2
dorl()
dord2
docl()
dord2
docd()
docd
dict of dicts
where each inner dict is a column
dord2
lorl()
dord2
locl()
dord2
lord()
dord2
locd()
dord2
dorl()
dord2
docl()
dord2
dord()

Comments