Numpy arrays don't play well with sympy objects (they're best if you use built-in numerical types with numpy). You should try sympy arrays instead, which will support something like . subs . Look at recent sympy posts that also use lambdify .
NumPy arrays have a fixed size at creation, unlike Python lists (which can grow dynamically). Changing the size of an ndarray will create a new array and delete the original. The elements in a NumPy array are all required to be of the same data type, and thus will be the same size in memory.
Numpy arrays is a typed array, the array in memory stores a homogenous, densely packed numbers. Python list is a heterogeneous list, the list in memory stores references to objects rather than the number themselves.
Having a data type (dtype) is one of the key features that distinguishes NumPy arrays from lists. In lists, the types of elements can be mixed.
I have a numpy array A with mpf elements that have decimal precision 100. Is this precision cast away if I decide to take the numpy dot product of A with itself?
If this is the case, is there any way to convert a numpy array to an mpmath matrix, so I can keep the precision?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With