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
1 change: 1 addition & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
path: _build/html/reports
- name: Upload "_build" folder (cache)
uses: actions/upload-artifact@v4
if: always()
with:
name: build-cache
path: _build
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- default
dependencies:
- python=3.13
- anaconda=2025.12
- anaconda=2026.06
- pip
- pip:
- jupyter-book>=1.0.4post1,<2.0
Expand Down
9 changes: 6 additions & 3 deletions lectures/doubts_or_variability.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ import datetime as dt
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas_datareader import data as web
from scipy.stats import norm
from scipy.optimize import brentq
```
Expand Down Expand Up @@ -2011,8 +2010,12 @@ end_date = dt.datetime(2007, 1, 1)


def _read_fred_series(series_id, start_date, end_date):
series = web.DataReader(series_id, "fred", start_date, end_date)[series_id]
series = pd.to_numeric(series, errors="coerce").dropna().sort_index()
# Download directly from FRED's CSV endpoint. This avoids pandas-datareader,
# which is unmaintained and incompatible with pandas 3.0.
url = f"https://fred.stlouisfed.org/graph/fredgraph.csv?id={series_id}"
df = pd.read_csv(url, index_col=0, parse_dates=True)
series = pd.to_numeric(df.iloc[:, 0], errors="coerce").dropna().sort_index()
series = series.loc[start_date:end_date]
if series.empty:
raise ValueError(f"FRED series '{series_id}' returned no data in sample window")
return series
Expand Down
Loading