MCPcopy Create free account
hub / github.com/PyTables/PyTables / write

Function write

examples/nested1.py:24–41  ·  view source on GitHub ↗
(file, desc, indexed)

Source from the content-addressed store, hash-verified

22
23
24def write(file, desc, indexed):
25 fileh = tb.open_file(file, "w")
26 table = fileh.create_table(fileh.root, "table", desc)
27 for colname in indexed:
28 table.colinstances[colname].create_index()
29
30 row = table.row
31 for i in range(10):
32 row["x"] = i
33 row["y"] = 10.2 - i
34 row["z"] = i
35 row["color"] = colors[random.choice(["red", "green", "blue"])]
36 row["info/name"] = "name%s" % i
37 row["info/info2/info3/z4"] = i
38 # All the rest will be filled with defaults
39 row.append()
40
41 fileh.close()
42
43
44# The sample nested class description

Callers 1

nested1.pyFile · 0.85

Calls 4

create_indexMethod · 0.80
create_tableMethod · 0.45
appendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected