Skip to content
0

Conclusion:

The Data

They have provided you with their bookings data in a file called hotel_bookings.csv, which contains the following:

ColumnDescription
Booking_IDUnique identifier of the booking.
no_of_adultsThe number of adults.
no_of_childrenThe number of children.
no_of_weekend_nightsNumber of weekend nights (Saturday or Sunday).
no_of_week_nightsNumber of week nights (Monday to Friday).
type_of_meal_planType of meal plan included in the booking.
required_car_parking_spaceWhether a car parking space is required.
room_type_reservedThe type of room reserved.
lead_timeNumber of days before the arrival date the booking was made.
arrival_yearYear of arrival.
arrival_monthMonth of arrival.
arrival_dateDate of the month for arrival.
market_segment_typeHow the booking was made.
repeated_guestWhether the guest has previously stayed at the hotel.
no_of_previous_cancellationsNumber of previous cancellations.
no_of_previous_bookings_not_canceledNumber of previous bookings that were canceled.
avg_price_per_roomAverage price per day of the booking.
no_of_special_requestsCount of special requests made as part of the booking.
booking_statusWhether the booking was cancelled or not.

Source (data has been modified): https://www.kaggle.com/datasets/ahsan81/hotel-reservations-classification-dataset

import  plotly.graph_objects as go
import plotly.express as px
import matplotlib.pyplot as plt
import pandas as pd
hotels = pd.read_csv("data/hotel_bookings.csv")
hotels
Hidden code
hotels.isna().sum()

1 hidden cell
#hotels['arrival_year'] = pd.to_datetime(hotels['arrival_year'])
hotels.value_counts('no_of_adults')
fig = px.histogram(data_frame = hotels, 
             x='no_of_adults',title='number  of adults and each percentage',color='no_of_adults')
fig.show()
fig = px.histogram(data_frame = hotels, 
             x='no_of_children',title='number  of childern and each percentage',color='no_of_children')
fig.show()
fig = px.histogram(data_frame = hotels, 
             x='no_of_weekend_nights',title='number  of weekend nights and each percentage',color='no_of_weekend_nights')
fig.show()
fig = px.histogram(data_frame = hotels, 
             x='no_of_week_nights',title='number  of weekend nights and each percentage',color='no_of_week_nights')
fig.show()
fig = px.histogram(data_frame = hotels, 
             x='type_of_meal_plan',title='number  of weekend nights and each percentage',color='type_of_meal_plan')
fig.show()
fig = px.histogram(data_frame = hotels, 
             x='required_car_parking_space',title='number  of weekend nights and each percentage',color='required_car_parking_space')
fig.show()