In [1]:
import numpy as np
In [18]:
points = {'1': (0.5, 0.5),
'2': (0.7, 0.7),
'3': (0.6, 0.6)}
In [19]:
test = points.values()
In [20]:
xy = tuple(zip(*test))
In [23]:
susi = np.polynomial.legendre.legvander2d(*xy, (2, 2))
In [25]:
tuple(susi)
Out[25]:
In [26]:
tuple(np.array([1, 2]))
Out[26]:
In [27]:
ValuesView
In [99]:
from multiprocessing import Pipe
In [112]:
pipe_out, pipe_in = Pipe(duplex=False)
In [125]:
for i in range(4000):
pipe_in.send('hello')
In [123]:
n = 0
while pipe_out.poll():
pipe_out.recv()
n += 1
In [124]:
n
Out[124]:
In [98]:
pipe_in.writable
Out[98]:
In [80]:
pipe_out.poll(timeout=1.)
Out[80]:
In [70]:
if pipe_out.poll(timeout=1.):
try:
pipe_out.recv()
except EOFError:
print('hello')
In [95]:
pipe_out.recv()
In [148]:
from time import monotonic, perf_counter, clock_getres, get_clock_info, CLOCK_MONOTONIC
In [149]:
clock_getres(CLOCK_MONOTONIC)
Out[149]:
In [147]:
get_clock_info('monotonic')
Out[147]:
In [ ]: