<jupyter_start><jupyter_text>`calendar_cleaned`<jupyter_code>calendar = pd.read_csv('data/Boston/calendar.csv')
calendar_cleaned = calendar.copy()
calendar_cleaned['date'] = pd.to_datetime(calendar_cleaned['date'])

convert_to_bool(calendar_cleaned, 'available')

remove_currency_signs(calendar_cleaned, 'price')
calendar_cleaned['price'] = calendar_cleaned['price'].astype(float)
calendar_cleaned.to_csv('data/Boston/cleaned_calendar.csv', index=False)
calendar_cleaned<jupyter_output><empty_output><jupyter_text>`listings_cleaned`<jupyter_code>listings = pd.read_csv('data/Boston/listings.csv')
listings.shape[0]
listings_short = listings.copy()
drop_cols = ['listing_url', 'scrape_id', 'last_scraped', 'name', 'space', 'experiences_offered', 
             'neighborhood_overview', 'notes', 'transit', 'thumbnail_url', 'medium_url', 'picture_url', 
             'xl_picture_url', 'host_url', 'host_name', 'host_location', 'host_about', 'host_thumbnail_url', 
             'host_picture_url', 'host_neighbourhood', 'host_listings_count', 'host_total_listings_count', 
             'host_verifications', 'host_has_profile_pic', 'street', 'neighbourhood', 'neighbourhood_group_cleansed', 
             'city', 'state', 'zipcode', 'market', 'smart_location', 'country_code', 'country', 'latitude', 
             'longitude', 'is_location_exact', 'bathrooms', 'beds', 'bed_type', 'square_feet', 
             'guests_included', 'extra_people', 'maximum_nights', 'calendar_updated', 'has_availability', 
             'availability_30', 'availability_60', 'availability_90', 'availability_365', 
             'calendar_last_scraped', 'requires_license', 'license', 'jurisdiction_names', 
             'require_guest_profile_picture', 'require_guest_phone_verification', 'calculated_host_listings_count']
listings_short.drop(drop_cols, axis=1, inplace=True)
listings_cleaned = listings_short.copy()
listings_cleaned.drop(['summary', 'host_acceptance_rate'], axis=1, inplace=True)
index = listings_short[listings_short.property_type.isnull()].index
listings_short.loc[index, 'property_type'] = 'Other'
listings_cleaned['bedrooms'].fillna(1, inplace=True)
listings_cleaned['bedrooms'] = listings_cleaned['bedrooms'].astype(int)
index = listings_short[listings_short.bedrooms == 0].index
listings_short.loc[index, 'bedrooms'] = 1
listings_cleaned.drop(listings_cleaned[listings_cleaned.review_scores_accuracy.isnull()].index, inplace=True)
listings_cleaned.drop(listings_cleaned[listings_cleaned.review_scores_location.isnull()].index, inplace=True)
listings_cleaned.drop(listings_cleaned[listings_cleaned.review_scores_rating.isnull()].index, inplace=True)
listings_cleaned.drop(listings_cleaned[listings_cleaned.host_response_time.isnull()].index, inplace=True)
listings_cleaned.drop(['weekly_price', 'monthly_price', 'security_deposit', 'cleaning_fee',
                       'access', 'interaction', 'house_rules'], axis=1, inplace=True)
listings_cleaned.isnull().sum()
listings_cleaned.shape<jupyter_output><empty_output><jupyter_text>**Summary:*** *neighbourhood_cleansed* remains since it is the only one of the three without missing values* missing values in *property_type* integrated in category *Other** replace NaN and 0 bedrooms with 1 * drop Boston-specific columns *access*, *interaction* and *house_rules** drop columns *weekly_price*, *monthly_price*, *security_deposit* and *cleaning_fee* due to large amount of missing values* drop rows with missing values for all host- and review-related columns<jupyter_code>listings_cleaned.to_csv('data/Boston/cleaned_listings.csv', index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13359094672922991, 'fraction_numerical': 0.0049682583494341705, 'mean_word_length': 7.669856459330144, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '502893', 'license': 'MIT', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1169, 'n_words': 182, 'path': 'Airbnb_Boston_Analysis.ipynb', 'repo_name': 'sandramuschkorgel/Udacity_Airbnb_Seattle_Analysis', 'size': '3623'}