I have some 3D data in three 1D arrays, one for each of x,y,z. Where all three arrays are of equal length, but the data range is N*M. For example:
x = [1, 2, 3, 1, 2, 3]
y = [1, 1, 1, 2, 2, 2]
z = [11, 12, 13, 14, 15, 16]
I want to plot this using one of matplotlib
s functions, most of which require as an input a single 2D array of size N*M, i.e:
z = [[11, 12, 13],
[14, 15, 16]]
I know I can write some loops in python to iterate through the three original arrays to put the data into the required N*M format, but my question is: is there a pre-existing python library or function for doing this? Possibly using something like numpy, although so far my research hasn't turned up any working solutions.
As an aside: I don't think the current title describes the problem well, so I am open to suggestions for a better title.