Skip to content

Commit d688ac4

Browse files
authored
[pandas] update figure size (#92)
* [pandas] update figure size * adjust fig
1 parent 76e291e commit d688ac4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lectures/pandas.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ of fields such as data science and machine learning.
4646
Here's a popularity comparison over time against STATA, SAS, and [dplyr](https://dplyr.tidyverse.org/) courtesy of Stack Overflow Trends
4747

4848
```{figure} /_static/lecture_specific/pandas/pandas_vs_rest.png
49-
:scale: 30
49+
:scale: 40
5050
```
5151

5252
Just as [NumPy](http://www.numpy.org/) provides the basic array data type plus core array operations, pandas
@@ -68,11 +68,11 @@ Throughout the lecture, we will assume that the following imports have taken
6868
place
6969

7070
```{code-cell} ipython
71+
%matplotlib inline
7172
import pandas as pd
7273
import numpy as np
7374
import matplotlib.pyplot as plt
7475
plt.rcParams["figure.figsize"] = [10,8] # Set default figure size
75-
%matplotlib inline
7676
import requests
7777
```
7878

@@ -472,7 +472,7 @@ ticker = read_data(ticker_list)
472472
Complete the program to plot the result as a bar graph like this one:
473473

474474
```{figure} /_static/lecture_specific/pandas/pandas_share_prices.png
475-
:scale: 50
475+
:scale: 80
476476
```
477477

478478
(pd_ex2)=
@@ -490,7 +490,7 @@ indices_list = {'^GSPC': 'S&P 500',
490490
Complete the program to show summary statistics and plot the result as a time series graph like this one:
491491

492492
```{figure} /_static/lecture_specific/pandas/pandas_indices_pctchange.png
493-
:scale: 53
493+
:scale: 80
494494
```
495495

496496
## Solutions
@@ -565,7 +565,7 @@ yearly_returns.describe()
565565
Then, to plot the chart
566566

567567
```{code-cell} python3
568-
fig, axes = plt.subplots(2, 2, figsize=(10, 6))
568+
fig, axes = plt.subplots(2, 2, figsize=(10, 8))
569569
570570
for iter_, ax in enumerate(axes.flatten()): # Flatten 2-D array to 1-D array
571571
index_name = yearly_returns.columns[iter_] # Get index name per iteration

0 commit comments

Comments
 (0)