interpolating values from a dataframe based on a column value
问题 Assuming I have a the following problem: import pandas as pd import numpy as np xp = [0.0, 0.5, 1.0] np.random.seed(100) df = pd.DataFrame(np.random.rand(10, 4), columns=['x0', 'y1', 'y2', 'y3']) df x0 y1 y2 y3 0 0.5434 0.2784 0.4245 0.8448 1 0.0047 0.1216 0.6707 0.8259 2 0.1367 0.5751 0.8913 0.2092 3 0.1853 0.1084 0.2197 0.9786 4 0.8117 0.1719 0.8162 0.2741 5 0.4317 0.9400 0.8176 0.3361 6 0.1754 0.3728 0.0057 0.2524 7 0.7957 0.0153 0.5988 0.6038 8 0.1051 0.3819 0.0365 0.8904 9 0.9809 0.0599