<jupyter_start><jupyter_text>Airbnb NYC Kaggle's Airbnb NYC data. More info about the data is here. EDA only.  Table of Contents1. [Imports](Imports)    2. [Data](Data)  3. [EDA](EDA)     Imports<jupyter_code># main
import numpy as np
import pandas as pd
import scipy.stats as stats
import pickle

# datetimes
import datetime as dt
from datetime import datetime
import time

# dataviz
%matplotlib notebook
import matplotlib.pyplot as plt
import seaborn as sns
import graphviz

# plot style
%config InteractiveShellApp.pylab_import_all = False
%pylab inline
pylab.rcParams['figure.figsize'] = (10, 7)

plt.style.use('seaborn-colorblind')

# outline
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

%precision %.3f

# pandas display
pd.set_option('display.max_rows', 200)
pd.set_option('display.max_columns', 100)

# warnings
import warnings
warnings.filterwarnings('ignore')<jupyter_output>Populating the interactive namespace from numpy and matplotlib<jupyter_text>Data<jupyter_code>df = pd.read_csv('../data/AB_NYC_2019.csv')
df.head()
len(df)
# %missing values
df.isna().mean()
# get rid of unnecessary columns
df = df.drop(['id','host_name','last_review'], axis=1)

# fill nan values
df['reviews_per_month'].fillna(0, inplace=True)
len(df[df['name'].isnull()])<jupyter_output><empty_output><jupyter_text>EDA<jupyter_code># Neighbourhood Group
df.neighbourhood_group.value_counts()
sns.boxplot(x='neighbourhood_group',y='price',data=df)
plt.ylim(-10,1000) # lots of outliers
# Neighbourhood
df.neighbourhood.value_counts().head(10)
# Room type
df.room_type.value_counts()
# Room types & Neighbourhood groups
g = sns.FacetGrid(data=df,col='neighbourhood_group',margin_titles=True,ylim=(0,600))
g.map(sns.boxplot,'room_type','price',palette='colorblind')
# Prices
sns.distplot(df.price,bins=100)
# Prices (<=600) across NYC
plt.figure(figsize=(10,10))
sns.scatterplot(x='latitude',y='longitude',data=df[df.price<=600],hue='price')
# Prices in Manhattan (<=1000)
plt.figure(figsize=(8,8))
sns.scatterplot(x='latitude',y='longitude',data=df[(df.neighbourhood_group=='Manhattan')&(df.price<=1000)],hue='price')
# Reviews histogram
sns.distplot(df.reviews_per_month,bins=30)
# Top 10 hosts
df.host_id.value_counts().head(10)
# Price vs Num of Reviews
sns.scatterplot(x='number_of_reviews',y='price',data=df,hue='neighbourhood_group')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14511041009463724, 'fraction_numerical': 0.024842271293375396, 'mean_word_length': 7.778546712802768, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '501322', 'license': 'Apache-2.0', 'n_tokens_mistral': 995, 'n_tokens_neox': 936, 'n_words': 176, 'path': 'notebooks/Airbnb_NYC.ipynb', 'repo_name': 'meren26/playground', 'size': '2536'}