Re: solving equation system



TG wrote:
Hi there.

Anyone knows how to use numpy / scipy in order to solve this ?

* A is an array of shape (n,)
* X is a positive float number
* B is an array of shape (n,)
* O is an array of shape (n,) containing only zeros.

A.X - B = O
min(X)

thanks.

Looks like an incorrectly specified degenerate linear least squares
problem. The function numpy.linalg.linear_least_squares might be able
to do what you want.


Carl Banks

.



Relevant Pages

  • [ANN] NumPy 1.0 release
    ... NumPy provides the features of both packages as well as comparable speeds in the domains where both were considered fast --- often beating both packages on certain problems. ... NumPy is a C-based extension module to Python that provides an N-dimensional array object, a collection of fast math functions, basic linear algebra, array-producing random number generators, and basic Fourier transform capabilities. ... A record array that builds on the advanced data-type support of the basic array object to allow field access using attribute look-up as well as to provide more ways to build-up a record-array. ... The whole point of NumPy is to unite the Numeric/Numarray development and user communities. ...
    (comp.lang.python)
  • Re: Loopless syntax for 2d in NumPy (or Numarray)
    ... heapq would not work on ... > NumPy arrays, right? ... it is then a normal Python array rather ...
    (comp.lang.python)
  • Re: Flattening lists
    ... Rhamphoryncus wrote: ... I have a similar use case in pyspread, which is a Python spreadsheet ... that employs numpy object arrays. ... there is one main numpy array of type "O". ...
    (comp.lang.python)
  • Re: NumPy 1.0 release
    ... download at http://www.numpy.org ... the 'array wars' are over; ... and its derivative distros than NumPy per se. ... undefined symbol: s_cat". ...
    (comp.lang.python)
  • Re: Dynamically growing numarray array.
    ... BTW, numpy is replacing numarray, so if you're just getting started, you will ... array one by one. ... preallocation strategy like lists do internally, but it's probably not worth it. ... "I have come to believe that the whole world is an enigma, a harmless enigma ...
    (comp.lang.python)