derivative in numpy

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • knielsen73@gmail.com

    derivative in numpy

    Hi,

    I am looking to do a simple derivative. I would expect such a function
    to be available in numpy, but can't find it. I have written my own,
    but just curious if anybody knows of such function in numpy.

    Cheers,
    Kim
  • Robert Kern

    #2
    Re: derivative in numpy

    knielsen73@gmai l.com wrote:
    Hi,
    >
    I am looking to do a simple derivative. I would expect such a function
    to be available in numpy, but can't find it. I have written my own,
    but just curious if anybody knows of such function in numpy.
    numpy.diff() handles the discrete difference. All you need to do is supply the
    scaling factor(s) to interpret it as a derivative.

    Again, numpy questions are best asked on the numpy mailing list.



    --
    Robert Kern

    "I have come to believe that the whole world is an enigma, a harmless enigma
    that is made terrible by our own mad attempt to interpret it as though it had
    an underlying truth."
    -- Umberto Eco

    Comment

    • Gary Herron

      #3
      Re: derivative in numpy

      knielsen73@gmai l.com wrote:
      Hi,
      >
      I am looking to do a simple derivative. I would expect such a function
      to be available in numpy, but can't find it. I have written my own,
      but just curious if anybody knows of such function in numpy.
      >
      Derivatives are a property of functions. Since numpy provides
      representations of arrays not functions, how would you expect this to work?

      To be more concrete, what you you expect the derivative of
      [ [ 1 2 ]
      [ 3 4 ]
      ]
      to be?

      Or do you have in mind some array representation of the coefficients of
      a function of some pre-defined type - like a polynomial?

      Gary Herron

      Comment

      • Ken Starks

        #4
        Re: derivative in numpy

        knielsen73@gmai l.com wrote:
        Hi,
        >
        I am looking to do a simple derivative. I would expect such a function
        to be available in numpy, but can't find it. I have written my own,
        but just curious if anybody knows of such function in numpy.
        >
        Cheers,
        Kim
        numpy and much more are wrapped together in 'sage' and you should get
        the functionality you need there.

        For a review, see:

        For the past two months or so, I’ve been slowly migrating my scientific workflow (that’s a fancy way of saying “my chaotic data hacking”) from Matlab ((R) (TM) (C)) to Pytho…

        Comment

        • Robert Kern

          #5
          Re: derivative in numpy

          Gary Herron wrote:
          knielsen73@gmai l.com wrote:
          >Hi,
          >>
          >I am looking to do a simple derivative. I would expect such a function
          >to be available in numpy, but can't find it. I have written my own,
          >but just curious if anybody knows of such function in numpy.
          >>
          >
          Derivatives are a property of functions. Since numpy provides
          representations of arrays not functions, how would you expect this to work?
          >
          To be more concrete, what you you expect the derivative of
          [ [ 1 2 ]
          [ 3 4 ]
          ]
          to be?
          >
          Or do you have in mind some array representation of the coefficients of
          a function of some pre-defined type - like a polynomial?
          Typically, when people ask questions like this, they have a uniform, discretely
          sampled version of the function, and they want the
          (forward,centra l,backward)-difference approximation of the derivative.

          --
          Robert Kern

          "I have come to believe that the whole world is an enigma, a harmless enigma
          that is made terrible by our own mad attempt to interpret it as though it had
          an underlying truth."
          -- Umberto Eco

          Comment

          • Ken Starks

            #6
            Re: derivative in numpy

            Ken Starks wrote:
            knielsen73@gmai l.com wrote:
            >Hi,
            >>
            >I am looking to do a simple derivative. I would expect such a function
            >to be available in numpy, but can't find it. I have written my own,
            >but just curious if anybody knows of such function in numpy.
            >>
            >Cheers,
            > Kim
            numpy and much more are wrapped together in 'sage' and you should get
            the functionality you need there.
            >
            For a review, see:
            >
            http://vnoel.wordpress.com/2008/05/0...n-thanks-sage/
            Sorry, the review isn't very useful. for something more focused on your
            request, see:

            SageMath is a free and open-source mathematical software system.

            Comment

            • castironpi

              #7
              Re: derivative in numpy

              On Jul 28, 5:34 pm, knielse...@gmai l.com wrote:
              Hi,
              >
              I am looking to do a simple derivative. I would expect such a function
              to be available in numpy, but can't find it. I have written my own,
              but just curious if anybody knows of such function in numpy.
              >
              Cheers,
               Kim
              I presume you are taking the numerical derivative, not the symbolic
              one.

              Comment

              Working...