say I have a user defined Structure, and some instances:
from ctypes import *
class Person(Structure):
_fields_ = [
("name", c_char * 16),
("age", c_int32),
("height", c_double),
("location", c_int32 * 2)
]
alice = Person(b"Alice", 25, 1.72, (3, 5))
bob = Person(b"Bob", 27, 1.77, (4, 3))
I would like to construct a Frame object like
f = dt.Frame([alice, bob])
print(f)
which would give
name age height location_0 location_1
0 Alice 25 1.72 3 5
1 Bob 27 1.77 4 3
right now, datatable will give ValueError: Unknown format 'T{(16)<c:name:<i:age:<d:height:(2)<i:location:}' with itemsize 40. It would be nice to be able create Frame objects this way.
As a plus, I don't think numpy or pandas fully supports such construction (numpy is close, but it can't handle C-string; it will break it up to 16 chars).
say I have a user defined Structure, and some instances:
I would like to construct a Frame object like
which would give
right now, datatable will give
ValueError: Unknown format 'T{(16)<c:name:<i:age:<d:height:(2)<i:location:}' with itemsize 40
. It would be nice to be able create Frame objects this way.As a plus, I don't think numpy or pandas fully supports such construction (numpy is close, but it can't handle C-string; it will break it up to 16 chars).