{"id":22039534,"url":"https://github.com/mpolinowski/hotel-booking-dataset","last_synced_at":"2026-04-20T10:31:37.641Z","repository":{"id":159260589,"uuid":"634550426","full_name":"mpolinowski/hotel-booking-dataset","owner":"mpolinowski","description":"Python Pandas Dataset Exploration with Hotel Demand Data.","archived":false,"fork":false,"pushed_at":"2023-04-30T13:58:39.000Z","size":1487,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T13:14:55.643Z","etag":null,"topics":["data-exploration","hotel-booking","pandas","python"],"latest_commit_sha":null,"homepage":"https://www.sciencedirect.com/science/article/pii/S2352340918315191","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolinowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-30T13:55:35.000Z","updated_at":"2025-01-27T05:03:22.000Z","dependencies_parsed_at":"2023-06-11T08:15:21.855Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/hotel-booking-dataset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpolinowski/hotel-booking-dataset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhotel-booking-dataset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhotel-booking-dataset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhotel-booking-dataset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhotel-booking-dataset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/hotel-booking-dataset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhotel-booking-dataset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32042970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-exploration","hotel-booking","pandas","python"],"created_at":"2024-11-30T11:11:10.328Z","updated_at":"2026-04-20T10:31:37.622Z","avatar_url":"https://github.com/mpolinowski.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hotel Booking Demand Dataset\n\n\u003c!-- TOC --\u003e\n\n- [Hotel Booking Demand Dataset](#hotel-booking-demand-dataset)\n  - [Dataset](#dataset)\n    - [Size](#size)\n    - [Missing Data](#missing-data)\n    - [Exploration](#exploration)\n      - [Data Columns](#data-columns)\n      - [Top Countries](#top-countries)\n      - [Average Daily Rates](#average-daily-rates)\n      - [Average Stays](#average-stays)\n      - [Average Cost per Stay](#average-cost-per-stay)\n      - [Percentage of Returning Guest](#percentage-of-returning-guest)\n      - [Correlate Bookings to Day of the Week](#correlate-bookings-to-day-of-the-week)\n      - [Bookings within a Date Range](#bookings-within-a-date-range)\n\n\u003c!-- /TOC --\u003e\n\n\n\n\u003e see [Hotel booking demand datasets](https://www.sciencedirect.com/science/article/pii/S2352340918315191), [Kaggle](https://www.kaggle.com/datasets/jessemostipak/hotel-booking-demand)\n\n```python\nimport numpy as np\nimport pandas as pd\nimport datetime\n```\n\n## Dataset\n\n```python\nhotel_bookings = pd.read_csv('datasets/hotel_bookings.csv')\nhotel_bookings.head(5)\n```\n\n### Size\n\n```python\n# complete number of rows\nprint(hotel_bookings.index)\n# RangeIndex(start=0, stop=119390, step=1)\n\n# complete number of columns\nprint(len(hotel_bookings.columns))\n# 32\n```\n\n### Missing Data\n\n```python\n# only show rows that have missing values\nhotel_bookings_nan = hotel_bookings[hotel_bookings.isna().any(axis=1)]\nhotel_bookings_nan\n# 119173 rows × 32 columns\n# only 119390 - 119173 =  217 rows don't have missing entries\n```\n\n| | hotel | is_canceled | lead_time | arrival_date_year | arrival_date_month | arrival_date_week_number | arrival_date_day_of_month | stays_in_weekend_nights | stays_in_week_nights | adults | ... | deposit_type | agent | company | days_in_waiting_list | customer_type | adr | required_car_parking_spaces | total_of_special_requests | reservation_status | reservation_status_date |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 0 | Resort Hotel | 0 | 342 | 2015 | July | 27 | 1 | 0 | 0 | 2 | ... | No Deposit | NaN | NaN | 0 | Transient | 0.00 | 0 | 0 | Check-Out | 01-07-15 |\n| 1 | Resort Hotel | 0 | 737 | 2015 | July | 27 | 1 | 0 | 0 | 2 | ... | No Deposit | NaN | NaN | 0 | Transient | 0.00 | 0 | 0 | Check-Out | 01-07-15 |\n| 2 | Resort Hotel | 0 | 7 | 2015 | July | 27 | 1 | 0 | 1 | 1 | ... | No Deposit | NaN | NaN | 0 | Transient | 75.00 | 0 | 0 | Check-Out | 02-07-15 |\n| 3 | Resort Hotel | 0 | 13 | 2015 | July | 27 | 1 | 0 | 1 | 1 | ... | No Deposit | 304.0 | NaN | 0 | Transient | 75.00 | 0 | 0 | Check-Out | 02-07-15 |\n| 4 | Resort Hotel | 0 | 14 | 2015 | July | 27 | 1 | 0 | 2 | 2 | ... | No Deposit | 240.0 | NaN | 0 | Transient | 98.00 | 0 | 1 | Check-Out | 03-07-15 |\n| ... |\n| 119385 | City Hotel | 0 | 23 | 2017 | August | 35 | 30 | 2 | 5 | 2 | ... | No Deposit | 394.0 | NaN | 0 | Transient | 96.14 | 0 | 0 | Check-Out | 06-09-17 |\n| 119386 | City Hotel | 0 | 102 | 2017 | August | 35 | 31 | 2 | 5 | 3 | ... | No Deposit | 9.0 | NaN | 0 | Transient | 225.43 | 0 | 2 | Check-Out | 07-09-17 |\n| 119387 | City Hotel | 0 | 34 | 2017 | August | 35 | 31 | 2 | 5 | 2 | ... | No Deposit | 9.0 | NaN | 0 | Transient | 157.71 | 0 | 4 | Check-Out | 07-09-17 |\n| 119388 | City Hotel | 0 | 109 | 2017 | August | 35 | 31 | 2 | 5 | 2 | ... | No Deposit | 89.0 | NaN | 0 | Transient | 104.40 | 0 | 0 | Check-Out | 07-09-17 |\n| 119389 | City Hotel | 0 | 205 | 2017 | August | 35 | 29 | 2 | 7 | 2 | ... | No Deposit | 9.0 | NaN | 0 | Transient | 151.20 | 0 | 2 | Check-Out | 07-09-17 |\n\n```python\n# which columns have the most missing entries\nhotel_bookings.isna().sum()\n\n# the columns company, agent and country have the most missing data:\n```\n\n|    |    |\n| -- | -- |\n| hotel | 0 |\n| is_canceled | 0 |\n| lead_time | 0 |\n| arrival_date_year | 0 |\n| arrival_date_month | 0 |\n| arrival_date_week_number | 0 |\n| arrival_date_day_of_month | 0 |\n| stays_in_weekend_nights | 0 |\n| stays_in_week_nights | 0 |\n| adults | 0 |\n| children | 4 |\n| babies | 0 |\n| meal | 0 |\n| country | 488 |\n| market_segment | 0 |\n| distribution_channel | 0 |\n| is_repeated_guest | 0 |\n| previous_cancellations | 0 |\n| previous_bookings_not_canceled | 0 |\n| reserved_room_type | 0 |\n| assigned_room_type | 0 |\n| booking_changes | 0 |\n| deposit_type | 0 |\n| agent | 16340 |\n| company | 112593 |\n| days_in_waiting_list | 0 |\n| customer_type | 0 |\n| adr | 0 |\n| required_car_parking_spaces | 0 |\n| total_of_special_requests | 0 |\n| reservation_status | 0 |\n| reservation_status_date | 0 |\n_dtype: int64_\n\n```python\n# drop columns with missing data\nhotel_bookings_dropped_nan = hotel_bookings.drop(['company', 'agent'], axis=1)\nhotel_bookings_dropped_nan.head(2)\n```\n\n```python\nhotel_bookings_dropped_nan[hotel_bookings_dropped_nan.isna().any(axis=1)]\n# 4 rows × 29 columns\n# only the 4 rows with missing data in the children column and 488 country column remain\n```\n\n### Exploration\n\n#### Data Columns\n\n```python\n# what columns do we have\npd.Series(hotel_bookings.columns)\n```\n\n|  |  |\n| -- | -- |\n| 0 | hotel |\n| 1 | is_canceled |\n| 2 | lead_time |\n| 3 | arrival_date_year |\n| 4 | arrival_date_month |\n| 5 | arrival_date_week_number |\n| 6 | arrival_date_day_of_month |\n| 7 | stays_in_weekend_nights |\n| 8 | stays_in_week_nights |\n| 9 | adults |\n| 10 | children |\n| 11 | babies |\n| 12 | meal |\n| 13 | country |\n| 14 | market_segment |\n| 15 | distribution_channel |\n| 16 | is_repeated_guest |\n| 17 | previous_cancellations |\n| 18 | previous_bookings_not_canceled |\n| 19 | reserved_room_type |\n| 20 | assigned_room_type |\n| 21 | booking_changes |\n| 22 | deposit_type |\n| 23 | agent |\n| 24 | company |\n| 25 | days_in_waiting_list |\n| 26 | customer_type |\n| 27 | adr |\n| 28 | required_car_parking_spaces |\n| 29 | total_of_special_requests |\n| 30 | reservation_status |\n| 31 | reservation_status_date |\n_dtype: object_\n\n\n#### Top Countries\n\n```python\n# top5 country codes\nhotel_bookings_dropped_nan['country'].value_counts().head(5)\n```\n\n|  |  |\n| -- | -- |\n| PRT | 48590 |\n| GBR | 12129 |\n| FRA | 10415 |\n| ESP | 8568 |\n| DEU | 7287 |\n_Name: country, dtype: int64_\n\n```python\nhotel_bookings_dropped_nan['country'].value_counts().head(15).plot.bar(figsize=(12,4),rot=65)\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_01.png)\n\n\n#### Average Daily Rates\n\n```python\nplot = hotel_bookings_dropped_nan.plot.scatter(\n    figsize=(12,8),\n    x='adr',\n    y='hotel')\n\n# there are only 2 hotels and all adr's are within 0-500$ with one outlier above 5000$\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_02.png)\n\n```python\n# find outlier\nhotel_bookings_dropped_nan.sort_values('adr', ascending=False).iloc[0]\n```\n\n|    |    |\n| -- | -- |\n| hotel | City Hotel |\n| is_canceled | 1 |\n| lead_time | 35 |\n| arrival_date_year | 2016 |\n| arrival_date_month | March |\n| arrival_date_week_number | 13 |\n| arrival_date_day_of_month | 25 |\n| stays_in_weekend_nights | 0 |\n| stays_in_week_nights | 1 |\n| adults | 2 |\n| children | 0.0 |\n| babies | 0 |\n| meal | BB |\n| country | PRT |\n| market_segment | Offline TA/TO |\n| distribution_channel | TA/TO |\n| is_repeated_guest | 0 |\n| previous_cancellations | 0 |\n| previous_bookings_not_canceled | 0 |\n| reserved_room_type | A |\n| assigned_room_type | A |\n| booking_changes | 1 |\n| deposit_type | Non Refund |\n| days_in_waiting_list | 0 |\n| customer_type | Transient |\n| adr | 5400.0 |\n| required_car_parking_spaces | 0 |\n| total_of_special_requests | 0 |\n| reservation_status | Canceled |\n| reservation_status_date | 19-02-16 |\n_Name: 48515, dtype: object_\n\n```python\nplot = hotel_bookings_dropped_nan.plot.hist(\n    column=[\"adr\"],\n    by=\"hotel\",\n    bins=100,\n    figsize=(10, 8)\n)\n\n# the outlier squeezes the first histogram and makes it hard to compare them\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_03.png)\n\n```python\n# let's find the outlier iloc and drop the row\nhotel_bookings_dropped_nan['adr'].idxmax()\n# 48515\n```\n\n```python\nhotel_bookings_dropped_outlier = hotel_bookings_dropped_nan.drop(48515, axis=0)\n\nplot = hotel_bookings_dropped_outlier.plot.hist(\n    column=[\"adr\"],\n    by=\"hotel\",\n    bins=100,\n    figsize=(10, 8)\n)\n\n# nice :)\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_04.png)\n\n```python\n# calculate the average daily rate `adr` for a guest staying at each hotel\nadr_by_hotel = hotel_bookings_dropped_nan.groupby('hotel').mean(numeric_only=True)['adr']\nadr_by_hotel\n```\n\n__Average Daily Rate__\n\n|    |    |\n| -- | -- |\n| hotel |  |\n| City Hotel | 105.304465 |\n| Resort Hotel | 94.952930 |\n_Name: adr, dtype: float64_\n\n\n#### Average Stays\n\n```python\n# how long do guest stay on average\nhotel_bookings_dropped_nan['total_days'] = hotel_bookings_dropped_nan['stays_in_weekend_nights'] + hotel_bookings_dropped_nan['stays_in_week_nights']\nhotel_bookings_dropped_nan['total_days'].head(5)\n```\n\n|    |    |\n| -- | -- |\n| 0 | 0 |\n| 1 | 0 |\n| 2 | 1 |\n| 3 | 1 |\n| 4 | 2 |\n_Name: total\\_days, dtype: int64_\n\n```python\naverage_stays = hotel_bookings_dropped_nan.groupby('hotel').mean(numeric_only=True).round(1)['total_days']\naverage_stays\n\n# the average staying time is 3 and 4.3 days, respectively\n```\n\n|  hotel  |    |\n| -- | -- |\n| City Hotel | 3.0 |\n| Resort Hotel | 4.3 |\n_Name: total|_days, dtype: float64_\n\n\n#### Average Cost per Stay\n\n```python\n# given the # of days and average daily adr we can calculate the average total cost per stay\nhotel_bookings_dropped_nan['total_cost'] = hotel_bookings_dropped_nan['total_days'] * hotel_bookings_dropped_nan['adr']\nhotel_bookings_dropped_nan['total_cost'].head(5)\n```\n\n|    |    |\n| -- | -- |\n| 0 | 0.0 |\n| 1 | 0.0 |\n| 2 | 75.0 |\n| 3 | 75.0 |\n| 4 | 196.0 |\n_Name: total\\_days, dtype: float64_\n\n```python\naverage_total_cost = hotel_bookings_dropped_nan.groupby('hotel').mean(numeric_only=True).round(2)['total_cost']\naverage_total_cost\n```\n\n| hotel   |    |\n| -- | -- |\n| City Hotel | 318.66 |\n| Resort Hotel | 435.45 |\n_Name: total_days, dtype: float64_\n\n\n#### Percentage of Returning Guest\n\n```python\n# total number of bookings per hotel\nhotel_bookings_dropped_nan.value_counts('hotel')\n```\n\n| hotel   |    |\n| -- | -- |\n| City Hotel | 79330 |\n| Resort Hotel | 40060 |\n_dtype: int64_\n\n```python\n# select only city hotel\ncity_hotel_bookings = hotel_bookings_dropped_nan[hotel_bookings_dropped_nan['hotel'] == 'City Hotel']\ncity_hotel_bookings['hotel'].head(5)\n```\n\n|    |    |\n| -- | -- |\n| 40060 | City Hotel |\n| 40061 | City Hotel |\n| 40062 | City Hotel |\n| 40063 | City Hotel |\n| 40064 | City Hotel |\n_Name: hotel, dtype: object_\n\n```python\n# select only resort hotel\nresort_hotel_bookings = hotel_bookings_dropped_nan[hotel_bookings_dropped_nan['hotel'] == 'Resort Hotel']\nresort_hotel_bookings['hotel'].head(5)\n```\n\n|    |    |\n| -- | -- |\n| 0 | Resort Hotel |\n| 1 | Resort Hotel |\n| 2 | Resort Hotel |\n| 3 | Resort Hotel |\n| 4 | Resort Hotel |\n_Name: hotel, dtype: object_\n\n```python\nreturning_customer_city_hotel = sum(city_hotel_bookings['is_repeated_guest'] == 1)\nreturning_customer_city_hotel\n# 2032\n```\n\n```python\ntotal_customer_city_hotel = hotel_bookings_dropped_nan.value_counts('hotel')['City Hotel']\ntotal_customer_city_hotel\n# 79330\n```\n\n```python\npercentage_returning_customer_city_hotel = (\n    returning_customer_city_hotel * 100 / total_customer_city_hotel\n)\npercentage_returning_customer_city_hotel.round(2)\n# 2.56%\n```\n\n```python\nreturning_customer_resort_hotel = sum(resort_hotel_bookings['is_repeated_guest'] == 1)\ntotal_customer_resort_hotel = hotel_bookings_dropped_nan.value_counts('hotel')['Resort Hotel']\n\npercentage_returning_customer_resort_hotel = (\n    returning_customer_resort_hotel * 100 / total_customer_resort_hotel\n)\npercentage_returning_customer_resort_hotel.round(2)\n# 4.44%\n```\n\n```python\n# visualize\nhotel_index = ['City Hotel', 'Resort Hotel']\nbooking_columns = ['Total Bookings', 'Returning Customer', 'Percentage']\ndata_array = [\n    (\n        total_customer_city_hotel,\n        returning_customer_city_hotel,\n        percentage_returning_customer_city_hotel.round(2)\n    ),\n    (\n        total_customer_resort_hotel,\n        returning_customer_resort_hotel,\n        percentage_returning_customer_resort_hotel.round(2)\n    )\n]\n\nreturn_customer_df = pd.DataFrame(data_array, hotel_index, booking_columns)\nreturn_customer_df\n```\n\n| Hotel   |  Total Bookings  |  Returning Customer  | Percentage|\n| -- | -- | -- | -- |\n| City Hotel | 79330 | 2032 | 2.56 |\n| Resort Hotel | 40060 | 1778 | 5.07 |\n\n```python\nplot = return_customer_df[\n    ['Total Bookings', 'Returning Customer']\n].plot.bar(figsize=(12,8), rot=0)\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_05.png)\n\n```python\narrival_date_year \t2016\narrival_date_month \tMarch\narrival_date_day_of_month \t25\nAug 27, 1989\npd.to_datetime(date_series)\n```\n\n```python\ncity_hotel_bookings[[\n    'arrival_date_year',\n    'arrival_date_month',\n    'arrival_date_day_of_month'\n]].head(5)\n```\n\n| | arrival_date_year | arrival_date_month | arrival_date_day_of_month |\n| -- | -- | -- | -- |\n| 40060 | 2015 | July | 1 |\n| 40061 | 2015 | July | 1 |\n| 40062 | 2015 | July | 1 |\n| 40063 | 2015 | July | 1 |\n| 40064 | 2015 | July | 2 |\n\n\n#### Correlate Bookings to Day of the Week\n\n```python\ncity_hotel_bookings['datetime'] = (\n    pd.to_datetime(\n        city_hotel_bookings['arrival_date_month'] + ' ' + city_hotel_bookings['arrival_date_day_of_month'].astype(str) + ' , ' + city_hotel_bookings['arrival_date_year'].astype(str)\n    )\n)\n\ncity_hotel_bookings['datetime']\n```\n\n|  |  |\n| -- | -- |\n| 40060 | 2015-07-01 |\n| 40061 | 2015-07-01 |\n| 40062 | 2015-07-01 |\n| 40063 | 2015-07-01 |\n| 40064 | 2015-07-02 |\n| ... |\n| 119385 | 2017-08-30 |\n| 119386 | 2017-08-31 |\n| 119387 | 2017-08-31 |\n| 119388 | 2017-08-31 |\n| 119389 | 2017-08-29 |\n_Name: datetime, Length: 79330, dtype: datetime64[ns]_\n\n```python\n# get weekday out of datetime object\ncity_hotel_bookings['datetime'].loc[40064].weekday()\n# 3 == Thursday\n```\n\n```python\ndays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']\n\ndef weekday(day_of_the_week):\n        return days[day_of_the_week]\n```\n\n```python\ncity_hotel_bookings['day_of_the_week'] = np.vectorize(weekday)(\n        city_hotel_bookings['datetime'].dt.weekday\n)\n\ncity_hotel_bookings['day_of_the_week'].tail(5)\n```\n\n|  |  |\n| -- | -- |\n| 119385 | Wednesday |\n| 119386 | Thursday |\n| 119387 | Thursday |\n| 119388 | Thursday |\n| 119389 | Tuesday |\n_Name: day\\_of\\_the\\_week, dtype: object_\n\n```python\nbookings_by_weekday_city_hotel = city_hotel_bookings.value_counts('day_of_the_week')\nbookings_by_weekday_city_hotel\n```\n\n| day_of_the_week |  |\n| -- | -- |\n| Friday | 13955 |\n| Thursday | 13009 |\n| Monday | 11823 |\n| Wednesday | 11229 |\n| Saturday | 10993 |\n| Sunday | 9194 |\n| Tuesday | 9127 |\n_dtype: int64_\n\n```python\nbookings_by_weekday_city_hotel.plot.bar(figsize=(12,8), rot=0)\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_06.png)\n\n```python\nresort_hotel_bookings['datetime'] = (\n    pd.to_datetime(\n        resort_hotel_bookings['arrival_date_month'] + ' ' + resort_hotel_bookings['arrival_date_day_of_month'].astype(str) + ' , ' + resort_hotel_bookings['arrival_date_year'].astype(str)\n    )\n)\n\nresort_hotel_bookings['day_of_the_week'] = np.vectorize(weekday)(\n        resort_hotel_bookings['datetime'].dt.weekday\n)\n\nbookings_by_weekday_resort_hotel = resort_hotel_bookings.value_counts('day_of_the_week')\nbookings_by_weekday_resort_hotel\n```\n\n| day_of_the_week |  |\n| -- | -- |\n| Saturday | 7062 |\n| Monday | 6348 |\n| Thursday | 6245 |\n| Friday | 5676 |\n| Sunday | 4947 |\n| Wednesday | 4910 |\n| Tuesday | 4872 |\n_dtype: int64_\n\n```python\nbookings_by_weekday_resort_hotel.plot.bar(figsize=(12,8), rot=0)\n```\n\n![Hotel Booking Demand Dataset](https://github.com/mpolinowski/hotel-booking-dataset/raw/master/assets/hotel_booking_demand_07.png)\n\n\n#### Bookings within a Date Range\n\n```python\nfirst_15 = hotel_bookings_dropped_nan['arrival_date_day_of_month'].apply(lambda day: day in range(1,16)).sum()\nfirst_15\n# 58152\n```\n\n```python\nlast_15 = hotel_bookings_dropped_nan['arrival_date_day_of_month'].apply(lambda day: day in range(15,32)).sum()\nlast_15\n# 65434\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fhotel-booking-dataset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fhotel-booking-dataset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fhotel-booking-dataset/lists"}