Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
numpy.interp
#1
Hi :)
I'd like to know if someone knows how to translate these linecodes from scilab into Python:

Var1=splin(x,y)
Var2=interp(p,x,y,Var1);

Because I think we can't interpolate "Var1" which is already an interpolation..

Thank you Smile
Reply
#2
The = sign is an operator that tells the interpreter to execute the statements on the right and use the result store (or use) computed on the left. Note that once the value is passed to the left, the method of how it got there can be discarded. There is still data in the python call stack that saves some of the information. If you have further interest in how this works, see: https://python-forum.io/Thread-Walking-t...call+stack
Also, please note that once the statement on the left has taken control, the data in the call stack on the right is eligible for garbage collection and may not be there for long. It is safe to use for non important processes (like error traceback operations) if used immediately) .
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 290 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,528 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,929 Apr-09-2019, 04:54 PM
Last Post: PhysChem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020