1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
df_it = pd.DataFrame(np.logspace(-1, 1, num=1000), columns=["x"]) pprint(df_it)
X, Y = df["xxx"], df["val"]
df_it["linear"] = df_it["x"].apply(lambda x: interp(x, X, Y)) df_it["np_log"] = df_it["x"].apply(lambda x: exp(interp(log(x), log(X), log(Y))))
df_it["Inter1"] = df_it["x"].apply(lambda x: sciInter(X, Y, kind="slinear")(x)) df_it["Inter2"] = df_it["x"].apply(lambda x: sciInter(X, Y, kind="quadratic")(x)) df_it["Inter3"] = df_it["x"].apply(lambda x: sciInter(X, Y, kind="cubic")(x))
df_it["Akima1"] = df_it["x"].apply(lambda x: sciAkima(X, Y, method="akima")(x)) df_it["PchipI"] = df_it["x"].apply(lambda x: sciPchip(X, Y)(x)) df_it["CubicS"] = df_it["x"].apply(lambda x: sciCubic(X, Y)(x)) pprint(df_it)
|