I have "n" numbers, I have to create a dictionary (which n will be its length and width will be i/n) to form a dictionary.
Let´s say that I have "n"=4
y 0.25 0.5 0.75
0.25
0.5
0.75
# code
data = {"y/x": []}
for i in range(n):
data["y/x"].append(i/n)
data[i/n] = []
Once generated the dictionary I have a list (which will always be even), you have to generate up to N/2 pairs.
List given
nums = [0.60365, 0.83799, 0.32960, 0.19322, 0.11220,
0.37751, 0.88492, 0.30934, 0.22888, 0.78212]
Coordinates
coord = [(0.60365, 0.83799), (0.3296, 0.19322), (0.1122, 0.37751), (0.88492, 0.30934), (0.22888, 0.78212)]
#code
coord = [((nums[i]), (nums[i+1]) % len(nums))
for i in range(0, len(nums), 2) if i < len(nums)-1]
print(coord)
How can I place the number of pairs that are within the dictionary intervals? In such a way that it looks like this?**
y/x 0 ->0.25 .25 -> .5 .5 -> .75 .75 -> 1
0 -> 0.25 1 1 0 0
.25 -> .5 1 2 0 1
.5 -> .75 0 0 0 1
.75 -> 1 0 1 1 0