text_html_output_1.png
from wordcloud import WordCloud

import matplotlib.pyplot as plt

import pandas as pd

abnb = pd.read_csv('/kaggle/input/airbnbopendata/Airbnb_Open_Data.csv')

abnb.columns

abnb.dtypes

abnb.memory_usage().sum()

abnb.isnull()

abnb.columns = [col.lower().replace(' ', '_') for col in abnb.columns]

abnb.shape

text = abnb.name[0] + abnb.name[1] + abnb.name[2] + abnb.name[4] + abnb.name[5]
word_cloud = WordCloud(background_color='white').generate(text)
plt.axis('off')

abnb.columns

def monthQ(month):
    if 0 < month <= 3:
        return 1
    if 3 < month <= 6:
        return 2
    if 6 < month <= 9:
        return 3
    if 9 < month <= 12:
        return 4

abnb['last_review'].head(3)
abnb['last_reviewed_year'] = abnb['last_review'].dt.year
abnb['last_reviewed_month'] = abnb['last_review'].dt.month
abnb['last_reviewed_day'] = abnb['last_review'].dt.day
print('\n')
abnb['quarterly_review'] = abnb['last_reviewed_month'].map(lambda m: monthQ(m))
print('\n')
abnb[['last_review', 'last_reviewed_year', 'last_reviewed_month', 'last_reviewed_day', 'quarterly_review']].head(5)