fare_class_mix

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

Fare class mix by carrier.

This query requires that the simulation was run while recording final fare details (i.e. with the fare or fare_final flags set on Config.db.write_items).

Parameters:
cnx : Database

scenario : str

burn_samples : int, default 100

The average total demand will be computed ignoring this many samples from the beginning of each trial.

Returns:

pandas.DataFrame – The resulting dataframe is indexed by carrier and booking_class, and has these columns:

  • avg_sold: Average number of sales in this booking class.

  • avg_revenue: Average total revenue earned from customers booking in

    this booking class.

  • avg_price: Average price per ticket from customers booking in this

    booking class.