From e8fbf9f9852076fabd2f3ef3ff5a60a1e5404047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 20 Jul 2019 18:31:35 +0200 Subject: [PATCH] Deque --- README.md | 1 + index.html | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 02752cc..13d14a2 100644 --- a/README.md +++ b/README.md @@ -1932,6 +1932,7 @@ from collections import deque .rotate(n=1) # Rotates elements to the right. ``` +### Example ```python >>> a = deque([1, 2, 3], maxlen=3) >>> a.append(4) diff --git a/index.html b/index.html index b42f861..429be43 100644 --- a/index.html +++ b/index.html @@ -1701,14 +1701,15 @@ cursor.execute('<query>', <dict/namedt <deque>.extendleft(<collection>) # Collection gets reversed. <deque>.rotate(n=1) # Rotates elements to the right. -
>>> a = deque([1, 2, 3], maxlen=3)
+

Example

>>> a = deque([1, 2, 3], maxlen=3)
 >>> a.append(4)
 [2, 3, 4]
 >>> a.appendleft(5)
 [5, 2, 3]
 >>> a.insert(1, 6)
 IndexError: deque already at its maximum size
-
+
+

#Threading

from threading import Thread, RLock
 
@@ -2106,7 +2107,7 @@ right = [[0.1 , 0.6< right = [[0.1, 0.6, 0.8], [0.1, 0.6, 0.8], [0.1, 0.6, 0.8]] # Shape: (3, 3) <- ! -

3. If neither non-matching dimension has size 1, rise an error.

Example

For each point returns index of its nearest point ([0.1, 0.6, 0.8] => [1, 2, 1]):

>>> points = np.array([0.1, 0.6, 0.8])
+

3. If neither non-matching dimension has size 1, rise an error.

Example

For each point returns index of its nearest point ([0.1, 0.6, 0.8] => [1, 2, 1]):

>>> points = np.array([0.1, 0.6, 0.8])
 [ 0.1,  0.6,  0.8]
 >>> wrapped_points = points.reshape(3, 1)
 [[ 0.1],