I have 20+ tables similar to table 1. where all letters represent actual values
Table 1:
$ / cars |<1 | 2 | 3 | 4+
<10,000 | a | b | c | d
20,000 | e | f | g | h
30,000 | i | j | k | l
40,000+ | m | n | o | p
A user input could be for example, (2.4, 24594) which is a value between f, g, j, and k. my python function definition and pseudo-code to calculate this bilinear interpolation is as follow:
def bilinear_interpolation( x_in, y_in, x_high, x_low, y_low, y_high ):
# interpolate with respect to x
# interpolate with respect to y
# return result
Q: How should i store the data from table 1 (a file, a dict, tuple of tuples, or dict of lists) so i can perform the bilinear interpolation most efficiently and correctly?