numeraire_dataset.zones.clean.compustat_annual_formation_clean#

numeraire_dataset.zones.clean.compustat_annual_formation_clean(funda: DataFrame) DataFrame[source]#

Prepare raw annual accounting fields for calendar-year portfolio formation.

A fiscal-year record ending in calendar year t receives formation_date = June 30, t+1. This is a portfolio-formation eligibility convention, not a claim about the firm’s actual filing date. It deliberately differs from compustat_annual_clean(), whose avail_date is a configurable fixed offset from each individual datadate.

The step is method-neutral: it preserves revt, cogs, at, gp, fyear, fyr, sic exactly as supplied. It neither constructs nor filters book equity, does not replace a missing cogs with zero, and does not precompute gross profitability. A downstream method can therefore make its own explicit choice, such as (revt - cogs) / at.

Compustat can contain more than one fiscal-year end for a firm in one calendar year. The latest exact source datadate is selected deterministically for each (gvkey, calendar year) before the selected date is month-end stamped. Rows that are identical across the output fields at that selected date collapse to one; conflicting output rows at the same selected date raise rather than depend on input order. Output has exactly one row per firm/calendar year.

Output columns: gvkey, datadate, formation_date, revt, cogs, at, gp, fyear, fyr, sic.