<jupyter_start><jupyter_text>In this notebook, I will answer this question : How each neighborhood in Boston performing in terms of ratings?<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt 
listing = pd.read_csv('data/listings.csv')
new_listing_df = listing.dropna(subset=['review_scores_rating'])
len(new_listing_df)<jupyter_output><empty_output><jupyter_text>~2772 datasets with rating, seems reasonable to analyze<jupyter_code>new_listing_df['price'] =  [np.nan if str(x) == 'nan' else float(str(x).replace('$','').replace(',','')) for x in new_listing_df.price]
new_listing_df.groupby(['neighbourhood_cleansed']).id.count().sort_values(ascending=False).plot(kind='bar')<jupyter_output><empty_output><jupyter_text>In terms of number listing per neighborhood, clearly there are neighborhood with low number of listings.So for my ratings analysis, I will consider the neighborhood with number of listing more than 50 to get a good quality data.<jupyter_code>plt.figure()
new_listing_df.groupby(['neighbourhood_cleansed']).filter(lambda x: x['id'].count() > 50).groupby(['neighbourhood_cleansed']).price.median().sort_values(ascending=False).plot(kind='bar', ylim=(60,250), title='Median price across neighbourhood')
plt.xlabel('Neighbourhood')
plt.ylabel('Price ($)')
plt.tight_layout()
plt.savefig('Median price across neighbourhood',quality=100, optimize=True)<jupyter_output><empty_output><jupyter_text>Donwtown and South Boston Waterfront has high median price as they are in prime location<jupyter_code>new_listing_df.review_scores_rating.hist(bins=40)<jupyter_output><empty_output><jupyter_text>the distribution is skewed to the left which means most of the listing has high rating<jupyter_code>plt.figure()
new_listing_df.groupby(['neighbourhood_cleansed']).filter(lambda x: x['id'].count() > 50).groupby(['neighbourhood_cleansed']).review_scores_rating.median().sort_values(ascending=False).plot(kind='bar', ylim=(80,100), title='Median ratings accross neighbourhood')
plt.xlabel('Neighbourhood')
plt.ylabel('Rating')
plt.tight_layout()
plt.savefig('Median ratings across neighbourhood')<jupyter_output><empty_output><jupyter_text>All the neighbourhood is having >90 ratings and the median ratings is similar across neighbourhood.<jupyter_code>new_listing_df[new_listing_df.neighbourhood_cleansed=='South Boston Waterfront'].review_scores_rating.hist(bins=40)
new_listing_df[new_listing_df.neighbourhood_cleansed=='Roxbury'].review_scores_rating.hist(bins=40)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12323943661971831, 'fraction_numerical': 0.012128325508607199, 'mean_word_length': 9.974248927038627, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 28, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '360904', 'license': 'FTL', 'n_tokens_mistral': 883, 'n_tokens_neox': 812, 'n_words': 172, 'path': 'Neighborhood_performance.ipynb', 'repo_name': 'okids/boston_airbnb_analysis', 'size': '2556'}