I want to use the natural cubic smoothing splines smooth.spline from R in Python (like som many others want as well (Python natural smoothing splines, Is there
Perhaps you could use rpy2's Function.rcall() method when calling smooth.spline?
import rpy2.robjects as robjects
r_y = robjects.FloatVector(y_train)
r_x = robjects.FloatVector(x_train)
r_smooth_spline = robjects.r['smooth.spline']
args = (('x',r_x), ('y',r_y), ('lambda',42)) # pattern (('argname', value),...)
# import R's "GlobalEnv" to evaluate the function
from rpy2.robjects import globalenv
spline1 = r_smooth_spline.rcall(args, globalenv)