Python Forum
Scilab -> Python translation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scilab -> Python translation
#1
Hi guys :)

With Scilab, you can create a splin and then interpolate it : (proba is a function I created )

Output:
Vpart = linspace(0,vmax, Nbr) Pt=rand(100,1) for i=1:Nbr Array(1,i)=intg(0,vmax, proba) end Curve=splin(Array,Vpart) Interp=interp(Pt, Pr, Array, Curve)


So, in Python, I tried this but np.interp doesn't want to interpolate a cubic spline .. :

Vpart=linspace(0,vmax, Nbr)
Pt=np.random.rand(Nbr,1)

Array=np.zeros(Nbr)
for i in range(0,Nbr):
     Array[i]=quad(0,vmax, proba)

Curve=interp1d(Array, Vpart, kind='cubic')
Interp=np.interp( .......
If someone knows how I could do something like that, It would be amazing :D

Thank u :) Tongue
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Translation AliceCu 2 671 May-16-2023, 09:05 PM
Last Post: deanhystad
  Translation API snippyro 0 1,263 Nov-02-2021, 01:09 AM
Last Post: snippyro
  [GoogleTrans] How can i print my translation word ?... JamieVanCadsand 7 11,749 Aug-29-2021, 12:01 PM
Last Post: Melcu54
  Translation of R Code to Python for Statistical Learning Course SterlingAesir 2 2,143 Aug-27-2020, 08:46 AM
Last Post: ndc85430
  recording a translation table into a file arbiel 0 1,457 Mar-31-2020, 02:33 PM
Last Post: arbiel
  Manipulation a file for translation apsyrtos 1 2,042 Sep-10-2019, 02:56 AM
Last Post: luoheng
  Powershell Session translation to Python; Session code seems to not work Maverick494 1 3,622 Jun-26-2018, 05:16 PM
Last Post: Maverick494
  Python2 to Python3 translation - .keys() 20salmon 1 3,533 Nov-03-2017, 10:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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