@@ -182,6 +182,7 @@ The code below produces the desired plot using Yahoo financial data via the `yfi
182182
183183``` {code-cell} ipython3
184184:tags: [hide-output]
185+
185186data = yf.download('AMZN', '2015-1-1', '2022-7-1')
186187```
187188
@@ -213,6 +214,7 @@ We get a similar picture if we look at other assets, such as Bitcoin
213214
214215``` {code-cell} ipython3
215216:tags: [hide-output]
217+
216218data = yf.download('BTC-USD', '2015-1-1', '2022-7-1')
217219```
218220
@@ -254,7 +256,7 @@ ax.hist(r, bins=60, alpha=0.4, label='bitcoin returns', density=True)
254256xmin, xmax = plt.xlim()
255257x = np.linspace(xmin, xmax, 100)
256258p = norm.pdf(x, np.mean(r), np.std(r))
257- ax.plot(x, p, 'k', linewidth=2, label='normal distribution')
259+ ax.plot(x, p, linewidth=2, label='normal distribution')
258260
259261ax.set_xlabel('returns', fontsize=12)
260262ax.legend()
@@ -768,12 +770,12 @@ Here is a plot of the firm size distribution for the largest 500 firms in 2020 t
768770
769771``` {code-cell} ipython3
770772---
771- tags: [hide-input]
772773mystnb:
773774 figure:
774775 caption: Firm size distribution
775776 name: firm-size-dist
776- ---
777+ tags: [hide-input]
778+ ---
777779
778780df_fs = pd.read_csv('https://media.githubusercontent.com/media/QuantEcon/high_dim_data/main/cross_section/forbes-global2000.csv')
779781df_fs = df_fs[['Country', 'Sales', 'Profits', 'Assets', 'Market Value']]
@@ -795,12 +797,12 @@ The size is measured by population.
795797
796798``` {code-cell} ipython3
797799---
798- tags: [hide-input]
799800mystnb:
800801 figure:
801802 caption: City size distribution
802803 name: city-size-dist
803- ---
804+ tags: [hide-input]
805+ ---
804806
805807# import population data of cities in 2023 United States and 2023 Brazil from world population review
806808df_cs_us = pd.read_csv('https://media.githubusercontent.com/media/QuantEcon/high_dim_data/main/cross_section/cities_us.csv')
@@ -822,12 +824,12 @@ The data is from the Forbes Billionaires list in 2020.
822824
823825``` {code-cell} ipython3
824826---
825- tags: [hide-input]
826827mystnb:
827828 figure:
828829 caption: Wealth distribution (Forbes Billionaires in 2020)
829830 name: wealth-dist
830- ---
831+ tags: [hide-input]
832+ ---
831833
832834df_w = pd.read_csv('https://media.githubusercontent.com/media/QuantEcon/high_dim_data/main/cross_section/forbes-billionaires.csv')
833835df_w = df_w[['country', 'realTimeWorth', 'realTimeRank']].dropna()
@@ -878,12 +880,12 @@ df_gdp1.dropna(inplace=True)
878880
879881``` {code-cell} ipython3
880882---
881- tags: [hide-input]
882883mystnb:
883884 figure:
884885 caption: GDP per capita distribution
885886 name: gdppc-dist
886- ---
887+ tags: [hide-input]
888+ ---
887889
888890fig, axes = plt.subplots(1, 2, figsize=(8.8, 3.6))
889891
@@ -934,7 +936,7 @@ mystnb:
934936 figure:
935937 caption: LLN failure
936938 name: fail-lln
937- ---
939+ ---
938940from scipy.stats import cauchy
939941
940942np.random.seed(1234)
0 commit comments