text_plain_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['last review'] = pd.to_datetime(abnb['last review'])
abnb['Construction year'] = pd.to_datetime(abnb['Construction year'])

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

abnb['review_rate_number'].unique()
print('\n')
abnb['review_rate_number'].value_counts()
print('\n')
abnb['rating'] = pd.cut(abnb['review_rate_number'], bins=[0, 1, 2, 3, 4, 5], labels=['One-Star', 'Two-Star', 'Three-Star', 'Four-Star', 'Five-Star'], include_lowest=True)
abnb['rating'] = abnb['rating'].cat.add_categories('missing values').fillna('missing values')
abnb[['review_rate_number', 'rating']].head(5)