Giter Site home page Giter Site logo

Comments (4)

esc avatar esc commented on July 24, 2024

Also, it should perhaps be Int not int:

In [5]: ds = dshape('2, 2, int')
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-5-813d8219d63f> in <module>()
----> 1 ds = dshape('2, 2, int')

/home/esc/git-working/blaze/blaze/datashape/__init__.pyc in dshape(o)
      8 def dshape(o):
      9     if isinstance(o, str):
---> 10         return parser.parse(o)
     11     elif isinstance(o, DataShape):
     12         return o

/home/esc/git-working/blaze/blaze/datashape/parser.pyc in parse(pattern)
    415     #       to trigger a re-creation of the parser.
    416     parser = load_parser(False)
--> 417     ds = parser(pattern)
    418 
    419     # Just take the type from "type X = Y" statements

/home/esc/anaconda/lib/python2.7/site-packages/ply/yacc.pyc in parse(self, input, lexer, debug, tracking, tokenfunc)
    263             return self.parseopt(input,lexer,debug,tracking,tokenfunc)
    264         else:
--> 265             return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
    266 
    267 

/home/esc/anaconda/lib/python2.7/site-packages/ply/yacc.pyc in parseopt_notrack(self, input, lexer, debug, tracking, tokenfunc)
    969                             del symstack[-plen:]
    970                             del statestack[-plen:]
--> 971                             p.callable(pslice)
    972                             symstack.append(sym)
    973                             state = goto[statestack[-1]][pname]

/home/esc/git-working/blaze/blaze/datashape/parser.pyc in p_rhs_expression_list__bit(p)
    239 def p_rhs_expression_list__bit(p):
    240     '''rhs_expression_list : BIT'''
--> 241     p[0] = (T.Type._registry[p[1]],)
    242 
    243 def p_rhs_expression_list__name(p):

KeyError: 'int'
In [6]: ds = dshape('2, 2, Int')

In [7]: ds
Out[7]: dshape("2, 2, Int")

from blaze.

esc avatar esc commented on July 24, 2024

Delay that order:

In [13]: ds
Out[13]: dshape("2, 2, Int")

In [14]: a = Array([1, 2, 3, 4], ds)
---------------------------------------------------------------------------
NotNumpyCompatible                        Traceback (most recent call last)
<ipython-input-14-0aecd0842e96> in <module>()
----> 1 a = Array([1, 2, 3, 4], ds)

/home/esc/git-working/blaze/blaze/table.pyc in __init__(self, obj, dshape, metadata, layout, params)
    177                                      params=params)
    178         else:
--> 179             self.data = CArraySource(obj, dshape=dshape, params=params)
    180 
    181         # children graph nodes

/home/esc/git-working/blaze/blaze/sources/chunked.pyc in __init__(self, data, dshape, params)
     61 
     62         if dshape:
---> 63             shape, dtype = to_numpy(dshape)
     64             self.ca = carray.carray(data, dtype=dtype, rootdir=rootdir, cparams=cparams)
     65             self.dshape = dshape

/home/esc/git-working/blaze/blaze/datashape/coretypes.pyc in to_numpy(ds)
    918         dtype = msr.to_dtype()
    919     else:
--> 920         raise NotNumpyCompatible('Datashape measure %s is not NumPy-compatible' % dim)
    921 
    922     if type(dtype) != np.dtype:

NotNumpyCompatible: Datashape measure 2 is not NumPy-compatible

from blaze.

goog avatar goog commented on July 24, 2024

err: Constructing a blaze array directly requires a data descriptor, not type <type 'list'>
the document under the docs directory is fresh and useful.

from blaze.

aterrel avatar aterrel commented on July 24, 2024

This has been fixed.

from blaze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.