Skip to content

Commit d5cf869

Browse files
authored
Merge pull request #51 from QuantEcon/translation-sync-2026-04-12T13-14-33-pr-524
🌐 [translation-sync] Improve clarity and fix errors in Numba lecture
2 parents 485dac4 + 289db1b commit d5cf869

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lectures/numba.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ translation:
1515
Overview: 概述
1616
Compiling Functions: 编译函数
1717
Compiling Functions::An Example: 示例
18-
Compiling Functions::An Example::Base Version: 基础版本
19-
Compiling Functions::An Example::Acceleration via Numba: 通过 Numba 加速
20-
Compiling Functions::How and When it Works: 工作原理与适用场景
21-
Sharp Bits: 注意事项
22-
Sharp Bits::Typing: 类型推断
23-
Sharp Bits::Global Variables: 全局变量
18+
Compiling Functions::How and When it Works: 工作原理与适用时机
19+
Type Inference: 类型推断
20+
Dangers and Limitations: 危险与局限
21+
Dangers and Limitations::Limitations: 局限性
22+
'Dangers and Limitations::A Gotcha: Global Variables': 一个陷阱:全局变量
23+
Dangers and Limitations::Caching Compiled Code: 缓存编译代码
2424
Multithreaded Loops in Numba: Numba 中的多线程循环
2525
Exercises: 练习
2626
---
@@ -238,18 +238,18 @@ def iterate(f, x0, n):
238238
x = f(x)
239239
return x
240240
241-
# Not jitted
241+
# 未经 jit 编译
242242
def g(x):
243243
return np.cos(x) - 2 * np.sin(x)
244244
245-
# This code throws an error
245+
# 这段代码会抛出错误
246246
try:
247247
iterate(g, 0.5, 100)
248248
except Exception as e:
249249
print(e)
250250
```
251251

252-
在当前情况下,我们可以通过编译 `g` 来轻松解决这个问题
252+
我们可以通过编译 `g` 来轻松修复这个错误
253253

254254
```{code-cell} ipython3
255255
@jit

0 commit comments

Comments
 (0)