Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .translate/state/pandas.md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source-sha: aacff3815993e8bea8db7b63df72a0a038e220c1
synced-at: "2026-08-05"
source-sha: 55c87c9fdbdb522866c5b6bbdc65c073941d7f16
synced-at: "2026-08-18"
model: claude-sonnet-5
mode: UPDATE
section-count: 5
tool-version: 0.25.0
tool-version: 0.26.0
6 changes: 3 additions & 3 deletions .translate/state/polars.md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source-sha: fb389e7722b4f70fce7835bd773df8eea2de9744
synced-at: "2026-08-04"
source-sha: 55c87c9fdbdb522866c5b6bbdc65c073941d7f16
synced-at: "2026-08-18"
model: claude-sonnet-5
mode: UPDATE
section-count: 6
tool-version: 0.24.0
tool-version: 0.26.0
4 changes: 2 additions & 2 deletions lectures/pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ s

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

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

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

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

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

Expand Down
24 changes: 9 additions & 15 deletions lectures/polars.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ df
این را با `pl.read_csv` می‌خوانیم

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

```{code-cell} ipython3
# Reload the dataset
url = ('https://raw.githubusercontent.com/QuantEcon/'
'lecture-python-programming/main/lectures/_static/'
'lecture_specific/pandas/data/test_pwt.csv')
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
df_full = pl.read_csv(url)
```

Expand Down Expand Up @@ -438,9 +434,7 @@ import pandas as pd
import time

# Small dataset -- Penn World Tables (~8 rows)
url = ('https://raw.githubusercontent.com/QuantEcon/'
'lecture-python-programming/main/lectures/_static/'
'lecture_specific/pandas/data/test_pwt.csv')
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
small_pd = pd.read_csv(url)
small_pl = pl.read_csv(url)
```
Expand Down Expand Up @@ -480,13 +474,13 @@ print(f"Small data -- pandas: {pd_small:.4f}s | Polars eager: {pl_small:.4f}s"

```{code-cell} ipython3
n = 5_000_000
np.random.seed(42)
rng = np.random.default_rng(42)

groups = np.random.choice(['A', 'B', 'C', 'D'], n)
values = np.random.randn(n)
weights = np.random.rand(n)
extra1 = np.random.randn(n)
extra2 = np.random.randn(n)
groups = rng.choice(['A', 'B', 'C', 'D'], n)
values = rng.standard_normal(n)
weights = rng.random(n)
extra1 = rng.standard_normal(n)
extra2 = rng.standard_normal(n)

big_pd = pd.DataFrame({
'group': groups, 'value': values,
Expand Down
Loading