You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ So, here we go...
52
52
- [> Let's see if you can guess this?/看看你能否猜到这一点?](#-lets-see-if-you-can-guess-this看看你能否猜到这一点)
53
53
-[Section: Appearances are deceptive!](#section-appearances-are-deceptive)
54
54
-[> Skipping lines?/跳过一行?](#-skipping-lines跳过一行)
55
-
-[> Teleportation *](#-teleportation-)
55
+
-[> Teleportation/空间移动*](#-teleportation空间移动-)
56
56
-[> Well, something is fishy...](#-well-something-is-fishy)
57
57
-[Section: Watch out for the landmines!](#section-watch-out-for-the-landmines)
58
58
-[> Modifying a dictionary while iterating over it](#-modifying-a-dictionary-while-iterating-over-it)
@@ -1267,17 +1267,17 @@ False
1267
1267
1268
1268
---
1269
1269
1270
-
### > Teleportation *
1270
+
### > Teleportation/空间移动 *
1271
1271
1272
1272
```py
1273
1273
import numpy as np
1274
1274
1275
1275
def energy_send(x):
1276
-
# Initializing a numpy array
1276
+
# 初始化一个 numpy 数组
1277
1277
np.array([float(x)])
1278
1278
1279
1279
def energy_receive():
1280
-
# Return an empty numpy array
1280
+
# 返回一个空的 numpy 数组
1281
1281
return np.empty((), dtype=np.float).tolist()
1282
1282
```
1283
1283
@@ -1288,12 +1288,12 @@ def energy_receive():
1288
1288
123.456
1289
1289
```
1290
1290
1291
-
Where's the Nobel Prize?
1291
+
谁来给我发个诺贝尔奖?
1292
1292
1293
-
#### 💡 Explanation:
1293
+
#### 💡 说明:
1294
1294
1295
-
* Notice that the numpy array created in the `energy_send` function is not returned, so that memory space is free to reallocate.
1296
-
* `numpy.empty()` returns the next free memory slot without reinitializing it. This memory spot just happens to be the same one that was just freed (usually, but not always).
0 commit comments