Skip to content

Commit 69b2b95

Browse files
authored
Merge pull request #164 from QuantEcon/pfix2
[pandas] small updates
2 parents f79e347 + 83d8c14 commit 69b2b95

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed
Loading

lectures/pandas.md

+4-12
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ tags: [hide-output]
4444
Its popularity has surged in recent years, coincident with the rise
4545
of fields such as data science and machine learning.
4646

47-
Here's a popularity comparison over time against STATA, SAS, and [dplyr](https://dplyr.tidyverse.org/) courtesy of Stack Overflow Trends
47+
Here's a popularity comparison over time against Matlab and STATA courtesy of Stack Overflow Trends
4848

4949
```{figure} /_static/lecture_specific/pandas/pandas_vs_rest.png
50-
:scale: 40
50+
:scale: 100
5151
```
5252

5353
Just as [NumPy](http://www.numpy.org/) provides the basic array data type plus core array operations, pandas
@@ -154,15 +154,7 @@ In essence, a `DataFrame` in pandas is analogous to a (highly optimized) Excel s
154154

155155
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.
156156

157-
```{only} html
158-
Let's look at an example that reads data from the CSV file `pandas/data/test_pwt.csv` that can be downloaded
159-
<a href=_static/lecture_specific/pandas/data/test_pwt.csv download>here</a>.
160-
```
161-
162-
```{only} latex
163-
Let's look at an example that reads data from the CSV file `pandas/data/test_pwt.csv` and can be downloaded
164-
[here](https://lectures.quantecon.org/_downloads/pandas/data/test_pwt.csv).
165-
```
157+
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.
166158

167159
Here's the content of `test_pwt.csv`
168160

@@ -178,7 +170,7 @@ Here's the content of `test_pwt.csv`
178170
"Uruguay","URY","2000","3219.793","12.099591667","25255.961693","78.978740282","5.108067988"
179171
```
180172

181-
Supposing you have this data saved as `test_pwt.csv` in the present working directory (type `%pwd` in Jupyter to see what this is), it can be read in as follows:
173+
We'll read this in from a URL using the `pandas` function `read_csv`.
182174

183175
```{code-cell} python3
184176
df = pd.read_csv('https://raw.githubusercontent.com/QuantEcon/lecture-python-programming/master/source/_static/lecture_specific/pandas/data/test_pwt.csv')

0 commit comments

Comments
 (0)