carrier_history

passengersim.database.common_queries.carrier_history(cnx: Database, *, scenario: str = None, burn_samples: int = 100) DataFrame[source]

Sample-level details of carrier-level measures.

This query delivers sample-by-sample aggregated summary results for the various carriers in the simulation. It requires that the simulation was run while recording leg bucket details (i.e. with the bucket flag set on Config.db.write_items).

Parameters:
cnx : Database

scenario : str, optional

burn_samples : int, default 100

The history will be returned ignoring this many samples from the beginning of each trial.

Returns:

pandas.DataFrame – The resulting dataframe is indexed by iteration, trial and sample, and columns defined with a two-level MultiIndex. The second level of the columns MultiIndex represents the carriers, while the top level includes these columns:

  • forecast_mean: Forecast mean (mu) at the beginning of the booking

    curve, summed over all this carrier’s legs in this sample.

  • forecast_stdev: Forecast standard deviation (sigma) at the beginning

    of the booking curve, aggregated over all this carrier’s legs in this sample.

  • sold: Total bookings accepted by this carrier in this sample.

  • revenue: Total revenue for this carrier in this sample.