Function reference
Packaged data
The book uses era_pl. Both namespaces share the same datasets and metadata.
| available_data | Return the names of packaged example datasets. |
| data_info | Return documentation, schema, and stored metadata for one dataset. |
| data_catalog | Return :func:data_info records for all packaged datasets. |
| load_data | Load a packaged example dataset as a Polars DataFrame. |
| load_farr_rda | Load an object from the upstream farr R package data repository. |
Polars event dates and Parquet
These helpers work with Polars frames. Functions that read CRSP data require access to those data. get_event_rets() and copy_inline() are not implemented in era_pl; the Ibis event-return API is listed below.
| get_trading_dates | Create a trading-date index from a CRSP daily index table. |
| get_annc_dates | Map all calendar dates onto the next available trading day. |
| get_event_dates | Expand event dates into trading-day windows. |
| load_parquet | Scan a parquet table from a WRDS-style local data directory. |
| cast_decimals | Cast all decimal columns in frame to Float64. |
Polars external data
These functions retrieve data from external services.
| get_ff_daily_factors | Download Ken French daily factor data as a Polars DataFrame. |
| get_ff_ind | Download Fama-French SIC industry definitions for a given scheme. |
| get_size_rets_monthly | Download Ken French monthly size-portfolio returns as a LazyFrame. |
| get_me_breakpoints | Download Ken French market-equity breakpoints as a LazyFrame. |
| drive_download | |
| ensure_lm_10x_summary_parquet |
Polars models and research design
| ols_dropcollinear | |
| get_got_data | Generate panel data with cross-sectional and time-series dependence. |
| get_test_scores | Simulate a panel of student test scores for DiD-style examples. |
| get_idd_periods | Construct adoption/rejection periods for the IDD dates example data. |
| fit_test_score_panel | Fast chapter-specific estimator for the test-score panel model. |
| rusboost | Fit a binary boosting model using at most size learner attempts. |
| predict_proba_series | |
| models.BoostModel | |
| models.ConstantProbModel |
Polars expression and dataframe methods
Importing era_pl registers the .era namespace on Polars objects.
| namespaces.EraExpr | Custom expression helpers used throughout the Polars-facing API. |
| namespaces.EraDataFrame | Custom DataFrame helpers used throughout the Polars-facing API. |
Polars tables, plots, and text
| modelsummary | Polars wrapper around era_py.modelsummary. |
| show_typst | |
| spline_smooth | |
| rdplot | |
| plotnine_star | Temporarily expose public plotnine names in the caller’s global namespace. |
| NumberedLines | A sequence of text lines that preserves original line numbers. |
| ptime | Display wall-clock time for a code block in notebook-friendly markdown. |
SEC indexes
SEC requests require an identifying user agent.
| sec_resolve_user_agent | |
| sec_parse_company_bytes | |
| sec_get_index | |
| sec_index_available_update | |
| sec_index_targets | |
| sec_index_update | |
| sec_index_update_all |
Pandas and Ibis API
The era_py namespace supports pandas workflows. Event-study and WRDS helpers require the ibis extra and access to the underlying research data. These functions are distinct from the Polars helpers above.
| Pandas and Ibis API | Functions in the era_py namespace. |