I am wondering how one can convert a 2D numpy array input of type "object" into a Cython memoryview? For example, if I have the following Cython exte ...
I am wondering how one can convert a 2D numpy array input of type "object" into a Cython memoryview? For example, if I have the following Cython exte ...
I want to create various small memoryviews in function temporarily and release them when the function is finished. Seems initialize the memoryview by ...
I'm implementing a parser for a binary (image) file format. memoryview seems to be an almost perfect solution for this: The parser class keeps the dat ...
Consider the following to create a linear array of size 4: a.shape should be (4,). However: What is going on? The original Python code gives the ...
In Python, memoryview gets a viewer for internal memories of bytes, bytearrays or whatever supports buffer protocal. If I use ctypes.string_at to get ...
I am trying to read/write and update the contents of the memory by using python. I found that there are many ways to go on like mmap,memoryview,id() a ...
I defined a ShareableList() to store strings in it by using the following code: from multiprocessing import shared_memory global_memory = shared_mem ...
I want to write a bytearray type into a memoryview type. What I tried: but it returned: I know that it is possible to write into memoryview via: ...
I am trying to connect the socket via the following code it throws an error memoryview: a bytes-like object is required, not 'list'. what can I do ...
Python2 code: What is the python3 equivalent? I tried to replace buffer with memoryview() but than name error becomes a type error: TypeError: memo ...
My current input of a function wrapped from a c++ class is a one dimensional numpy array, e.g., func(np.array([1,2,3])) for which my cython descriptio ...
I want to check whether a memory view is initialized with None. I have a function like this: I get this error when I compile this: Is the proble ...
Say we have a 1 dimensional numpy array or list that we use as an input to a function, i.e., func(np.array[1.5, 2.5, 3.5]), where this function comes ...
I have a function(func) in a c++ class and want to call it from the python side to invoke the following sequence with the lowest latency possible: 1_ ...
Due to this, I need to use python memoryview.cast('I') to access a FPGA avoiding double read/write strobe. No panic, you wont need an FPGA to answer t ...
Is there a pure Python way of transposing a memoryview? Python memoryviews can represent more than just a 1-dimensional chunk of bytes. They can re ...
I ran into what I thought was going to be a very simple problem (and I hope it is!), which is to take raw data out of memory, and decode it to a Unico ...
I have boiled my problem down to a small reproducible test case: In file 1 (custom_cython.pyx) file I have the following: In file 2 (custom_cython ...
I am having trouble creating a simple class in Cython. There is little documentation related to handling memoryviews for arrays in C++ wrappers. I wan ...
While migrating some old python 2 code to python 3, I ran into some problems populating structured numpy arrays from bytes objects. I have a parser ...