/ ---
/ jupyter:
/   jupytext:
/     text_representation:
/       extension: .q
/       format_name: light
/       format_version: '1.5'
/       jupytext_version: 1.14.4
/ ---

/ + [markdown] cell_id="00000-cf86aa3b-6115-4f6f-8f26-8874e4b910e5" deepnote_cell_type="text-cell-h1" tags=[]
/ # Data&nbsp;Visualization&nbsp;on&nbsp;Hotel&nbsp;Review&nbsp;datasets&nbsp;from&nbsp;Kaggle

/ + [markdown] cell_id="00001-b97745dc-73cb-4206-946c-14e1d48c4fce" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Importing&nbsp;all&nbsp;necessary libraries

/ + cell_id="00000-0a70ab7d-a2e4-49ba-920e-2ba698324956" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=4727 execution_start=1623877970027 source_hash="2fb80a92" tags=[]
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv('Hotel_Reviews.csv')

/ + cell_id="00001-a1987f61-927f-4f37-bc1e-a70d86f7f7b0" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=10 execution_start=1623877974763 source_hash="52430027" tags=[]
df.dtypes

/ + cell_id="00002-c28d4314-671b-44d4-921b-2caba116b7fd" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=21 execution_start=1623877974770 source_hash="14f60b8f" tags=[]
df.shape

/ + [markdown] cell_id="00003-7b6ffe11-1933-414e-a533-66c03daa4321" deepnote_cell_type="markdown" tags=[]
/ Total Count of Data

/ + cell_id="00003-c4959e8e-c522-4b67-9e42-0a8c193c9a1d" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=104 execution_start=1623877974788 source_hash="6cd8acfd" tags=[]
df.head(2)

/ + [markdown] cell_id="00007-d4b2b84c-c55f-48fd-ae13-38b1f4b91e6c" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Describe Numerical&nbsp;Data ( Mean, Max, Average, Standard Deviation )

/ + cell_id="00005-e7df7621-987d-4749-992e-6882b41757ef" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=260 execution_start=1623877974901 source_hash="f88152d9" tags=[]
df.describe()

/ + [markdown] cell_id="00010-c9b5fe3d-4cc0-44fd-bf95-87574c9c66c3" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Average&nbsp;Score&nbsp;Bar-graph across&nbsp;Hotels

/ + cell_id="00007-52b0bc5b-6423-4c9c-9c71-24f8f5db5894" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=558 execution_start=1623877975205 source_hash="a5c8941" tags=[]
data_plot = df[["Hotel_Name","Average_Score"]]
fig, ax = plt.subplots(figsize=(30,5))
sns.countplot(ax = ax,x = "Average_Score",data=data_plot)

/ + [markdown] cell_id="00011-a132437e-93f1-4486-8bf3-24460d8a7edb" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Reviewer&nbsp;Score&nbsp;Count&nbsp;across&nbsp;the&nbsp;datasets

/ + cell_id="00009-600e5f5e-03e9-4a8d-a090-ee9d1e05cc94" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=627 execution_start=1623877975783 source_hash="9f452050" tags=[]
data_plot = df[["Hotel_Name","Reviewer_Score"]]
fig, ax = plt.subplots(figsize=(30,5))
sns.countplot(ax = ax,x = "Reviewer_Score",data=data_plot)

/ + [markdown] cell_id="00013-abd644a4-8bbc-4a32-b595-febc6a56cdb4" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Top&nbsp;Hotels&nbsp;by&nbsp;Average&nbsp;score

/ + cell_id="00013-23d7cbf3-a4ba-4e89-9293-e13e53abc48b" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=271 execution_start=1623877976411 source_hash="852dd5a4" tags=[]
top_hotels = (
    df.groupby(["Hotel_Name"])["Average_Score"].mean()\
                                               .sort_values(ascending=False)\
                                               .reset_index()
                                               .head()
)
plt.subplots(figsize=(20,5))
sns.barplot(x="Hotel_Name", y="Average_Score", data=top_hotels)
plt.show()

/ + [markdown] cell_id="00015-fa9c87f7-20e8-4166-af97-b9ba804d75b9" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Bottom&nbsp;Hotels&nbsp;by&nbsp;Average&nbsp;Score

/ + cell_id="00013-19747d1e-7e21-4018-8966-0774cad6a722" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=329 execution_start=1623877976697 source_hash="a4c5ca48" tags=[]
bottom_hotels = (
    df.groupby(["Hotel_Name"])["Average_Score"].mean()\
                                               .sort_values()\
                                               .reset_index()\
                                               .head()
)
plt.subplots(figsize=(20,5))
sns.barplot(x="Hotel_Name", y="Average_Score", data=bottom_hotels)
plt.show()

/ + [markdown] cell_id="00017-1b73c183-b80d-40fb-80eb-65b04ecda001" deepnote_cell_type="text-cell-h3" tags=[]
/ ### No&nbsp;Reviewer&nbsp;Type&nbsp;data column like Hotel Review data set on Cloud

/ + [markdown] cell_id="00018-f53466a1-50ff-404a-9633-e886a2650b97" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Top&nbsp;Reviewer&nbsp;nationality&nbsp;by&nbsp;average&nbsp;score

/ + cell_id="00013-73d124d4-c691-41a0-91c9-dad8a1ab5ef6" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=228 execution_start=1623877977076 source_hash="23fdea15" tags=[]
top_rev_nation = (
    df.groupby(["Reviewer_Nationality"])["Average_Score"].mean()\
                                               .sort_values(ascending=False)\
                                               .reset_index()\
                                               .head()
)
plt.subplots(figsize=(20,5))
sns.barplot(x="Reviewer_Nationality", y="Average_Score", data=top_rev_nation)
plt.show()

/ + [markdown] cell_id="00020-fabe8cb5-8357-43d5-859e-8d60d0d578a2" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Bottom&nbsp;Reviewer&nbsp;nationality&nbsp;by&nbsp;average&nbsp;score

/ + cell_id="00018-d0d5b184-b5e9-4288-9984-89cd2a6802a9" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=259 execution_start=1623877977326 source_hash="1eb7e45e" tags=[]
bottom_rev_nation = (
    df.groupby(["Reviewer_Nationality"])["Average_Score"].mean()\
                                               .sort_values()\
                                               .reset_index()\
                                               .head()
)
plt.subplots(figsize=(20,5))
sns.barplot(x="Reviewer_Nationality", y="Average_Score", data=bottom_rev_nation)
plt.show()

/ + [markdown] cell_id="00023-9159c37f-4322-45f5-8e45-c89f24ffc1ca" deepnote_cell_type="text-cell-h3" tags=[]
/ ### Reviewer&nbsp;Score&nbsp;Counts

/ + cell_id="00016-77387b64-5f1c-46a8-858a-4f698c16341a" deepnote_cell_type="code" deepnote_to_be_reexecuted=false execution_millis=539 execution_start=1623877977588 source_hash="2375e34b" tags=[]
df['Reviewer_Score'].value_counts().plot(kind='bar', figsize = (20, 5))

/ + [markdown] created_in_deepnote_cell=true deepnote_cell_type="markdown" tags=[]
/ <a style='text-decoration:none;line-height:16px;display:flex;color:#5B5B62;padding:10px;justify-content:end;' href='https://deepnote.com?utm_source=created-in-deepnote-cell&projectId=c892c304-c1f7-421d-9c75-7743e43b9f27' target="_blank">
/ <img alt='Created in deepnote.com' style='display:inline;max-height:16px;margin:0px;margin-right:7.5px;' src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODBweCIgaGVpZ2h0PSI4MHB4IiB2aWV3Qm94PSIwIDAgODAgODAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU0LjEgKDc2NDkwKSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT5Hcm91cCAzPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkxhbmRpbmciIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJBcnRib2FyZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEyMzUuMDAwMDAwLC<KEY> > </img>
/ Created in <span style='font-weight:600;margin-left:4px;'>Deepnote</span></a>

StarcoderdataJupyterScriptsDedupFiltered