Curve fitting for each column in Pandas + extrapolate values
I have a data set with some 300 columns, each of them depth-dependent. The simplified version of the Pandas DataFrame would look something like this: import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy_optimize import curve_fit df1 = pd.DataFrame({'depth': [1.65, 2.15, 2.65, 3.15, 3.65, 4.15, 4.65, 5.15, 5.65, 6.15, 6.65, 7.15, 7.65, 8.15, 8.65], '400.0': [13.909261, 7.758734, 3.513627, 2.095409, 1.628918, 0.782643, 0.278548, 0.160153, -0.155895, -0.152373, -0.147820, -0.023997, 0.010729, 0.006050, 0.002356], '401.0': [14.581624, 8.173803, 3.757856, 2.223524, 1