I have a dictionary with five keys and three values corresponding to each key:
mySubList1 = [[1, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6], [2, 8, 4, 6, 7, 8, 9, 10, 11, 12, 12, 13]]
mySubList2 = [[0, -1, 3, 4, 4, 6, -2, 3, 1, 0, -20, -2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15]]
mySubList3 = [[2, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1], [-1, -3, 44, 22, 4, 7, 7, 8, 9, 10, 11, 20]]
my_dictionary = {
"Dimensions: ": [],
"Shape: ": [],
"Mean: ": [],
"Median: ": [],
"Standard Deviation: ": [],
}
for i in mySubList1, mySubList2, mySubList3:
print(i)
my_dictionary['Dimensions: '].append(np.ndim(i))
my_dictionary['Shape: '].append(np.shape(i))
my_dictionary['Mean: '].append(np.mean(i))
my_dictionary['Median: '].append(np.median(i))
my_dictionary['Standard Deviation: '].append(np.std(i))
What I am trying to do is iterate over each of the key-value pairs, in the format: Set 1 Key1: Value1 Key2: Value1 Key3: Value1 Key4: Value1 Key5: Value1
Set 2 Key1: Value2 Key2: Value2 Key3: Value2 Key4: Value2 Key5: Value2
And so on.
What I have so far is:
for key, value in my_dictionary.items():
print(key, value)
Which gives me an undesired output in the format:
Key1: Value1, Value2, Value3
Any pointers?