bookings_by_timeframe¶
-
passengersim.database.common_queries.bookings_by_timeframe(cnx: Database, scenario: str, from_fare_detail: bool =
False, burn_samples: int =100) DataFrame[source]¶ Average bookings and revenue by carrier, booking class, and timeframe.
This query requires that the simulation was run while recording supporting details (i.e. with the bookings or fare flags set on Config.db.write_items).
- Parameters:
- cnx : Database¶
- scenario : str¶
- from_fare_detail : bool, default False¶
Reconstruct this table from the fare_detail table. This is generally slower than accessing the bookings table directly, and also requires substantially more data to have been saved into the database by setting the fare flag on Config.db.write_items
- burn_samples : int, default 100¶
The bookings will be computed ignoring this many samples from the beginning of each trial. This argument is nominally ignored by this query unless from_fare_detail is true, although the simulator will have already ignored the burned samples when storing the data in the bookings table.
- Returns:
pandas.DataFrame – The resulting dataframe is indexed by trial, carrier, class, and days_prior, and has these columns:
avg_sold: Average number of sales.
avg_business: Average number of sales to passengers in the business segment.
avg_leisure: Average number of sales to leisure passengers.
- avg_revenue: Average total revenue earned from customers booking in this
booking class in this time period.
- avg_price: Average price per ticket from customers booking in this booking
class in this time period