new here, and this is my first ever question, I hope I can reciprocate by answering other peoples questions in the future.
I have two pandas dataframes, A & B, each containing float64 values, both with the same dimensions and same index and column float64 numerical entries. E.g.
A
0.5 1.0 1.5 2.0
-1.947417e-15 0.015178 0.045640 0.074928 0.100943
-5.000000e-01 0.047697 0.149200 0.256133 0.359234
-1.000000e+00 0.082972 0.272634 0.494826 0.733841
-1.500000e+00 0.120121 0.417265 0.811659 1.303373
-2.000000e+00 0.155978 0.572880 1.206698 2.159998
B
0.5 1.0 1.5 2.0
-1.947417e-15 0.003859 0.018968 0.042486 0.070368
-5.000000e-01 0.003859 0.036093 0.100487 0.187447
-1.000000e+00 -0.007340 0.018968 0.107873 0.254083
-1.500000e+00 -0.029713 -0.038906 0.042486 0.178620
-2.000000e+00 -0.059926 -0.134084 -0.091504 0.032577
I would like to be able to lookup a fixed value (e.g. 0.25) in each data column in A, returning the (linearly) interpolated index value for each column (but only when the value exists in the range of the column data values - so not column 0.5 in A). Dataframe A will always have the column data monotonically increasing.
Once I have the interpolated index values for each column in Dataframe A for a data value, say 0.25, then I would like to retrieve the values within Dataframe B that have the same 'coordinates', i.e. the interpolated index and equivalent column value.
So for example, a lookup of 0.25 in A, then for column 1.5 would interpolate the index between 0 and -0.5, somewhere close to but greater than the value -0.5. The value returned from B would be a lookup of the index in B for column 1.5, so returning somewhere between 0.042486 and 0.100487, close to but less than 0.100487 value. I would want to return these '0.25' coordinate values in A and lookup & interpolate for the equivalent values in each column in B.
Slightly confusing, does it make sense?
I've done a lot of searching and can find some pandas dataframe interpolation methods, but generally they are in the context of filling in of NaNs.
I'm very appreciative of the help, so thank you in advance for reading and thinking about this. Maybe it is a simple solution, but I can't think of it or find it online anywhere.