-
-
Save pzwang/ce09394e928890825263 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [7]: class Custom(Record): | |
...: max = int32 | |
...: min = int32 | |
...: @derived | |
...: def mid(self): | |
...: return (self.min + self.max)/2 | |
...: | |
In [8]: Custom | |
Out[8]: __main__.Custom | |
In [9]: type(Custom) | |
Out[9]: blaze.datashape.record.DeclMeta | |
In [10]: print Custom | |
<class '__main__.Custom'> | |
In [11]: a = Table([(5,10), (12,24), (20,24)], Custom) | |
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-11-5f74679e3d45> in <module>() | |
----> 1 a = Table([(5,10), (12,24), (20,24)], Custom) | |
/Users/pwang/continuum/src/blaze-core/blaze/table.pyc in __init__(self, data, dshape, metadata, layout, params) | |
451 self.data = CTableSource(data, dshape=dshape, params=params) | |
452 # Pull the labels from the datashape | |
--> 453 self._axes = self._datashape[-1].names | |
454 else: | |
455 raise ValueError | |
TypeError: 'DeclMeta' object does not support indexing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment