load_reports
¶
Load Prevention of Future Death reports as a DataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_date
|
str
|
Inclusive lower bound for the report date in |
'2000-01-01'
|
end_date
|
str
|
Inclusive upper bound for the report date in |
'2050-01-01'
|
n_reports
|
int or None
|
Keep only the most recent |
None
|
refresh
|
bool
|
If |
False
|
Returns:
Type | Description |
---|---|
DataFrame
|
Reports filtered by date, sorted newest first and optionally
limited to |
Raises:
Type | Description |
---|---|
ValueError
|
If start_date is after end_date. |
FileNotFoundError
|
If the dataset cannot be downloaded. |
Examples:
from pfd_toolkit import load_reports
df = load_reports(start_date="2020-01-01", end_date="2022-12-31", n_reports=100)
df.head()