Skip to content
Open
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/polars.md.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source-sha: 55c87c9fdbdb522866c5b6bbdc65c073941d7f16
synced-at: "2026-08-18"
source-sha: b0c58ab96a9c537fcf766e4f2d9fd32f4a0fc2f7
synced-at: "2026-10-13"
model: claude-sonnet-5
mode: UPDATE
section-count: 6
tool-version: 0.26.0
tool-version: 0.29.4
8 changes: 6 additions & 2 deletions lectures/polars.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,8 @@ print(f"Polars lazy: {lazy_time:.4f}s")

یک پایگاه داده مهم برای اقتصاددانان [FRED](https://fred.stlouisfed.org/) است --- مجموعه‌ای گسترده از داده‌های سری زمانی که توسط فدرال رزرو سنت‌لوئیس نگهداری می‌شود.

متد `read_csv` در Polars می‌تواند داده را مستقیماً از یک URL دریافت کند.
فایل CSV را با استفاده از [requests](https://requests.readthedocs.io/en/latest/) دانلود می‌کنیم
و محتوای آن را به متد `read_csv` در Polars می‌دهیم.

از `try_parse_dates=True` برای تجزیه خودکار ستون تاریخ استفاده می‌کنیم

Expand All @@ -581,7 +582,10 @@ fred_url = ('https://fred.stlouisfed.org/graph/fredgraph.csv?'
'fgst=lin&fgsnd=2020-02-01&line_index=1&'
'transformation=lin&vintage_date=2024-07-29&'
'revision_date=2024-07-29&nd=1948-01-01')
data = pl.read_csv(fred_url, try_parse_dates=True)
import requests

r = requests.get(fred_url)
data = pl.read_csv(r.content, try_parse_dates=True)
```

بیایید چند ردیف اول را بررسی کنیم
Expand Down
Loading