I have some data, which is a function of two variables, let's say a and b.
f(a,b)
In maths terms, we can think of f as a surface viewed in 3D. The problem is, what is a good data structure to store this data in? I need to plot f as a function of a for constant b and f as a function of b for constant a. Currently I'm using a dict of arrays, something like this:
f['a1'] = [b1,b2,b3]
but then if I now want to plot f as a function of a with b constant I have to re-make another dict by hand:
f['b1'] = [a1,a2,a3]
which is proving extremely cumbersome and makes my code unreadable. Is there a nice way to store such 3D data in some numpy data structure or using built in python data structures?