<jupyter_start><jupyter_text>Quick look at the data structure   1 -  Import Libraries<jupyter_code>import numpy as np 
import pandas as pd<jupyter_output><empty_output><jupyter_text>2 - Quick look at the data structure  2.1 - Load the data<jupyter_code>listings = pd.read_csv("../input/airbnb_052020_listings.csv", dtype={'zipcode':np.string_, 
                                                            'weekly_price':np.string_, 
                                                            'monthly_price':np.string_})<jupyter_output><empty_output><jupyter_text>2.2 - Quick look<jupyter_code>print('(row,columns) =', listings.shape)
listings.head()
for i,x in enumerate(listings):
    print(i,' : ', x)
listings_selected_attributs = ['id',
                               'host_is_superhost',
                               'host_total_listings_count',
                               'host_verifications',
                               'neighbourhood_cleansed',
                               'zipcode',
                               'latitude',
                               'longitude',
                               'is_location_exact',
                               'property_type',
                               'room_type',
                               'bathrooms',
                               'bedrooms',
                               'beds',
                               'bed_type',
                               'amenities',
                               'accommodates',
                               'price',
                               'minimum_nights',
                               'maximum_nights',
                               'calendar_updated',
                               'calendar_last_scraped',
                               'instant_bookable',
                               'cancellation_policy',
                               'availability_365',
                              ]
listings_selected = listings[listings_selected_attributs].copy()
listings_selected = listings_selected.set_index('id')
print('(row,columns) =', listings_selected.shape)
listings_selected.head()
listings_selected.info()
listings_selected[['accommodates','bedrooms','room_type','beds','bed_type']]
listings_selected.isna().sum()
#zipcode
listings_selected['zipcode'] = pd.to_numeric(listings_selected['zipcode'], errors='coerce')
listings_selected['zipcode'] = listings_selected['zipcode'].map(lambda x: int(x) if x in range(75001,75021,1) else np.nan)
listings_selected['zipcode'].head()
listings_selected.isna().sum()
#price
listings_selected['price']<jupyter_output><empty_output><jupyter_text>- Il faut mettre les prix au bon format en enlevant le $<jupyter_code>def convert_prices(price):
    if pd.isna(price):
        return price
    price = np.na = price.split('$')[1]
    price_split = price.split(',')
    if(len(price_split) == 2):
        price = price_split[0] + price_split[1]
    return pd.to_numeric(price)
listings_selected['price'] = listings_selected['price'].map(convert_prices)
listings_selected.head()
listings_selected.info()
listings_selected.to_csv('../input/dataset/airbnb_052020.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11037527593818984, 'fraction_numerical': 0.011352885525070956, 'mean_word_length': 1.789797713280563, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '104100', 'license': 'Unlicense', 'n_tokens_mistral': 904, 'n_tokens_neox': 871, 'n_words': 128, 'path': 'notebooks/QuickLookData.ipynb', 'repo_name': 'k-kaci/airbnb-paris', 'size': '3171'}