spline

Pandas interpolation to extend data is giving bad results

Pandas interpolation to extend data is giving bad results Question: I have a dataset with ‘DEN’ values as a function of ‘Z’, which goes to Z = ~425000, but I would like to extend it up to Z = 500000. I attempted to do this by adding a new data point to my pandas column …

Total answers: 1

How to use xticks and marker functions for smooth line graph – matplotlib

How to use xticks and marker functions for smooth line graph – matplotlib Question: I make a line graph more smooth by applying the following lines of code (based on this post): import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import make_interp_spline #create random data years = list(range(1998, 2021, 1)) print(len(years)) #23 random_values …

Total answers: 1

Python equivalent of Matlab bsplinepolytraj function?

Python equivalent of Matlab bsplinepolytraj function? Question: Good morning everyone, this is my first question so I apologize in advance for any kind of mistake. Let me explain my problem: I need to generate a trajectory for a robotic arm from a set of waypoints. In Matlab I used the function bsplinepolytraj, but now I …

Total answers: 2

How to perform cubic spline interpolation in python?

How to perform cubic spline interpolation in python? Question: I have two lists to describe the function y(x): x = [0,1,2,3,4,5] y = [12,14,22,39,58,77] I would like to perform cubic spline interpolation so that given some value u in the domain of x, e.g. u = 1.25 I can find y(u). I found this in …

Total answers: 8

Splines with Python (using control knots and endpoints)

Splines with Python (using control knots and endpoints) Question: I’m trying to do something like the following (image extracted from wikipedia) #!/usr/bin/env python from scipy import interpolate import numpy as np import matplotlib.pyplot as plt # sampling x = np.linspace(0, 10, 10) y = np.sin(x) # spline trough all the sampled points tck = interpolate.splrep(x, …

Total answers: 5