I am trying to do the following with nimpy. In python I can do,
    
    
    >>>
    >>> import numpy
    >>> a = numpy.arange(5)
    >>> for i in a:
                 print(i)
    
    0
    1
    2
    3
    4
    >>>
    
    
    Run

Similarly when I do the following using nimpy, 
    
    
    import nimpy
    
    let numpy = pyImport("numpy")
    let a = numpy.arange(5)
    
    for i in a:
      echo("i = ", $i)
    
    
    
    Run

I get this error:
    
    
    call_py_2.nim(6, 10) Error: type mismatch: got <PyObject>
    but expected one of:
    iterator items(a: cstring): char
    iterator items(E: typedesc[enum]): E:type
    iterator items[IX, T](a: array[IX, T]): T
    iterator items[T](a: set[T]): T
    iterator items[T](a: openArray[T]): T
    iterator items(a: string): char
    iterator items[T](a: seq[T]): T
    iterator items[T](s: HSlice[T, T]): T
    
    
    Run

How do I correct this?

Reply via email to