image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

lista = pd.read_csv('/kaggle/input/airbnb-gz/listings_gz.csv')
calendar = pd.read_csv('/kaggle/input/airbnb-gz/calendar_gz.csv')
reviews = pd.read_csv('/kaggle/input/airbnb-gz/reviews_gz.csv')
mapa = plt.imread('/kaggle/input/mapamelbourne/Melbourne.png')

lista['price'] = lista['price'].str.lstrip('$')
lista['price'] = lista['price'].str.replace(',', '')
lista['price'] = pd.to_numeric(lista['price'], downcast='float')

lista['host_since'] = pd.to_datetime(lista['host_since'])

calendar['price'] = calendar['price'].str.lstrip('$')
calendar['price'] = calendar['price'].str.replace(',', '')
calendar['price'] = pd.to_numeric(calendar['price'], downcast='float')
calendar['adjusted_price'] = calendar['adjusted_price'].str.lstrip('$')
calendar['adjusted_price'] = calendar['adjusted_price'].str.replace(',', '')
calendar['adjusted_price'] = pd.to_numeric(calendar['adjusted_price'], downcast='float')

bins = range(0, 400, 20)
plt.hist(lista['minimum_nights'], bins, histtype='bar', rwidth=1.2)
plt.xlabel('Mínimas noites')
plt.ylabel('Contagem')
plt.plot
plt.axvline(calendar['minimum_nights'].mean(), linestyle='dashed', color='red')
plt.show()