Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to input a numpy matrix? #33

Open
XiaomingY opened this issue Dec 5, 2018 · 1 comment
Open

Is it possible to input a numpy matrix? #33

XiaomingY opened this issue Dec 5, 2018 · 1 comment

Comments

@XiaomingY
Copy link

Hi,

Is it possible to input a numpy matrix and use numpy.asmatrix to cast input as numpy matrix? What I am trying to do it use one CPython component to read a big binary file as matrix then use the second CPython component to get information out of the matrix. By using two component, i think I could avoid the slow process of reading the file every time a variable changes.

Another question is how to input a file path? Can you give an example? I tried a couple of ways but did not manage to get it to work. Many thanks.

@MahmoudAbdelRahman
Copy link
Owner

MahmoudAbdelRahman commented Oct 30, 2019

I suggest that you interchange numpy matrices between different components using numpy.dumps(the_np_array) and read it from the other component as numpy.loads(the_dumps_array)

https://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.ndarray.dumps.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants