I have data in this format:
from itertools import permutations
import random
values = [val for val in range(5)]
xy_coordinate_pairs = list(permutations(values, 2))
z_values = [random.randint(0,20) for val in range(len(xy_coordinate_pairs))]
data = dict(zip(xy_coordinate_pairs,z_values))
{(0, 1): 4,
(0, 2): 20,
(0, 3): 16,
(0, 4): 12,
(1, 0): 6,
(1, 2): 3,
(1, 3): 6,
(1, 4): 16,
(2, 0): 19,
(2, 1): 17,
(2, 3): 17,
(2, 4): 11,
(3, 0): 18,
(3, 1): 13,
(3, 2): 11,
(3, 4): 20,
(4, 0): 20,
(4, 1): 19,
(4, 2): 6,
(4, 3): 0}
And I'd like to plot this as a 3d surface plot, where the x and y coordinates are the first and second value respectively in the key tuples, and the z (height of surface plot) are the dictionary values. How would I go about doing this?
Thanks so much and have a great day.