Vermillion Vermillion - 1 year ago 135
Python Question

Create n x n cell of vectors in python

In Matlab, I have a 9x9 cell variable, where each cell element contains a column vector.

How can I implement this in Python, using numpy?

Answer Source

You can make a numpy array of python objects like this:

import numpy
a = numpy.empty((9,9),dtype='object')
a[0,0] = numpy.array([1,2,3,4])
a[0,1] = ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download