-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
40 lines (29 loc) · 888 Bytes
/
Copy pathtest.py
File metadata and controls
40 lines (29 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""import tkinter as tk
from tkinter.ttk import Treeview
import time
window = tk.Tk()
tree = Treeview(window, columns=("A", "B"))
tree.heading("A", command=lambda: print(tree.selection()))
tree.pack()
for i in range(5):
tree.insert("", "end", values=(i, i**2))
window.mainloop()"""
"""
def _shift(arr, n):
if n >= 0:
return np.concatenate((np.full(n, 0), arr[:-n]))
else:
return np.concatenate((arr[-n:], np.full(-n, 0)))
import numpy as np
array = np.array(np.random.random_integers(0, 200, 64)).reshape((8, 8))
middle = len(array) // 2
array = array.T
for column in range(len(array)):
maximum, = np.where(array[column] == np.max(array[column]))
maximum = maximum[0]
print(maximum)
print(_shift(array[column], middle - maximum))
if maximum != 0:
array[column] = _shift(array[column], middle - maximum)
print(array.T)
"""