Skip to content

Commit 55c87c9

Browse files
mmckyclaude
andauthored
Read test_pwt.csv from data-lectures (Track D) (#612)
All four reads pointed at this repo's own raw URL — one unsplit literal in pandas.md and three URLs split across three string literals each in polars.md. Each collapses to a single literal of the data-lectures form (github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv); patching the stem line alone would have left the filename appended to a path that no longer exists in the flat published tree. pandas.md's prose loses the stale pandas/data/ path prefix. Data landed first in QuantEcon/data-lectures#98. The local copy at _static/lecture_specific/pandas/data/ is deleted in a follow-up PR only after this repoint has propagated to the three synced translation repos (.zh-cn/.fr/.fa) and all four sites have republished — their lectures fetch the same URL live at cell execution. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 81d9734 commit 55c87c9

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎lectures/pandas.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ In essence, a `DataFrame` in pandas is analogous to a (highly optimized) Excel s
153153

154154
Thus, it is a powerful tool for representing and analyzing data that are naturally organized into rows and columns, often with descriptive indexes for individual rows and individual columns.
155155

156-
Let's look at an example that reads data from the CSV file `pandas/data/test_pwt.csv`, which is taken from the [Penn World Tables](https://www.rug.nl/ggdc/productivity/pwt/pwt-releases/pwt-7.0).
156+
Let's look at an example that reads data from the CSV file `test_pwt.csv`, which is taken from the [Penn World Tables](https://www.rug.nl/ggdc/productivity/pwt/pwt-releases/pwt-7.0).
157157

158158
The dataset contains the following indicators
159159

@@ -169,7 +169,7 @@ The dataset contains the following indicators
169169
We'll read this in from a URL using the `pandas` function `read_csv`.
170170

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

‎lectures/polars.md‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ As in {doc}`pandas`, let's work with data from the [Penn World Tables](https://w
158158
We read this in using `pl.read_csv`
159159

160160
```{code-cell} ipython3
161-
url = ('https://raw.githubusercontent.com/QuantEcon/'
162-
'lecture-python-programming/main/lectures/_static/'
163-
'lecture_specific/pandas/data/test_pwt.csv')
161+
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
164162
df = pl.read_csv(url)
165163
df
166164
```
@@ -344,9 +342,7 @@ Instead of executing each operation immediately, lazy mode collects the full que
344342

345343
```{code-cell} ipython3
346344
# Reload the dataset
347-
url = ('https://raw.githubusercontent.com/QuantEcon/'
348-
'lecture-python-programming/main/lectures/_static/'
349-
'lecture_specific/pandas/data/test_pwt.csv')
345+
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
350346
df_full = pl.read_csv(url)
351347
```
352348

@@ -422,9 +418,7 @@ import pandas as pd
422418
import time
423419
424420
# Small dataset -- Penn World Tables (~8 rows)
425-
url = ('https://raw.githubusercontent.com/QuantEcon/'
426-
'lecture-python-programming/main/lectures/_static/'
427-
'lecture_specific/pandas/data/test_pwt.csv')
421+
url = 'https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv'
428422
small_pd = pd.read_csv(url)
429423
small_pl = pl.read_csv(url)
430424
```

0 commit comments

Comments
 (0)