Skip to content

Commit 39f9f7d

Browse files
authored
🌐 [translation-sync] Read test_pwt.csv from data-lectures (Track D) (#153)
* Update translation: lectures/pandas.md * Update translation: .translate/state/pandas.md.yml * Update translation: lectures/polars.md * Update translation: .translate/state/polars.md.yml
1 parent b0dcc5a commit 39f9f7d

4 files changed

Lines changed: 17 additions & 23 deletions

File tree

.translate/state/pandas.md.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
source-sha: aacff3815993e8bea8db7b63df72a0a038e220c1
2-
synced-at: "2026-08-05"
1+
source-sha: 55c87c9fdbdb522866c5b6bbdc65c073941d7f16
2+
synced-at: "2026-08-18"
33
model: claude-sonnet-5
44
mode: UPDATE
55
section-count: 5
6-
tool-version: 0.25.0
6+
tool-version: 0.26.0

.translate/state/polars.md.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
source-sha: fb389e7722b4f70fce7835bd773df8eea2de9744
2-
synced-at: "2026-08-04"
1+
source-sha: 55c87c9fdbdb522866c5b6bbdc65c073941d7f16
2+
synced-at: "2026-08-18"
33
model: claude-sonnet-5
44
mode: UPDATE
55
section-count: 6
6-
tool-version: 0.24.0
6+
tool-version: 0.26.0

lectures/pandas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ s
159159

160160
بنابراین، یک ابزار قدرتمند برای نمایش و تحلیل داده‌هایی است که به طور طبیعی در سطرها و ستون‌ها سازماندهی شده‌اند، اغلب با اندیس‌های توصیفی برای سطرها و ستون‌های فردی.
161161

162-
بیایید به مثالی نگاه کنیم که داده را از فایل CSV `pandas/data/test_pwt.csv` می‌خواند، که از [Penn World Tables](https://www.rug.nl/ggdc/productivity/pwt/pwt-releases/pwt-7.0) گرفته شده است.
162+
بیایید به مثالی نگاه کنیم که داده را از فایل CSV `test_pwt.csv` می‌خواند، که از [Penn World Tables](https://www.rug.nl/ggdc/productivity/pwt/pwt-releases/pwt-7.0) گرفته شده است.
163163

164164
مجموعه داده شامل شاخص‌های زیر است
165165

@@ -174,7 +174,7 @@ s
174174
ما این را از یک URL با استفاده از تابع `read_csv` در `pandas` خواهیم خواند.
175175

176176
```{code-cell} ipython3
177-
df = pd.read_csv('https://raw.githubusercontent.com/QuantEcon/lecture-python-programming/main/lectures/_static/lecture_specific/pandas/data/test_pwt.csv')
177+
df = pd.read_csv('https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv')
178178
type(df)
179179
```
180180

lectures/polars.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ df
174174
این را با `pl.read_csv` می‌خوانیم
175175

176176
```{code-cell} ipython3
177-
url = ('https://raw.githubusercontent.com/QuantEcon/'
178-
'lecture-python-programming/main/lectures/_static/'
179-
'lecture_specific/pandas/data/test_pwt.csv')
177+
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
180178
df = pl.read_csv(url)
181179
df
182180
```
@@ -360,9 +358,7 @@ plt.show()
360358

361359
```{code-cell} ipython3
362360
# Reload the dataset
363-
url = ('https://raw.githubusercontent.com/QuantEcon/'
364-
'lecture-python-programming/main/lectures/_static/'
365-
'lecture_specific/pandas/data/test_pwt.csv')
361+
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
366362
df_full = pl.read_csv(url)
367363
```
368364

@@ -438,9 +434,7 @@ import pandas as pd
438434
import time
439435
440436
# Small dataset -- Penn World Tables (~8 rows)
441-
url = ('https://raw.githubusercontent.com/QuantEcon/'
442-
'lecture-python-programming/main/lectures/_static/'
443-
'lecture_specific/pandas/data/test_pwt.csv')
437+
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
444438
small_pd = pd.read_csv(url)
445439
small_pl = pl.read_csv(url)
446440
```
@@ -480,13 +474,13 @@ print(f"Small data -- pandas: {pd_small:.4f}s | Polars eager: {pl_small:.4f}s"
480474

481475
```{code-cell} ipython3
482476
n = 5_000_000
483-
np.random.seed(42)
477+
rng = np.random.default_rng(42)
484478
485-
groups = np.random.choice(['A', 'B', 'C', 'D'], n)
486-
values = np.random.randn(n)
487-
weights = np.random.rand(n)
488-
extra1 = np.random.randn(n)
489-
extra2 = np.random.randn(n)
479+
groups = rng.choice(['A', 'B', 'C', 'D'], n)
480+
values = rng.standard_normal(n)
481+
weights = rng.random(n)
482+
extra1 = rng.standard_normal(n)
483+
extra2 = rng.standard_normal(n)
490484
491485
big_pd = pd.DataFrame({
492486
'group': groups, 'value': values,

0 commit comments

Comments
 (0)