-
Notifications
You must be signed in to change notification settings - Fork 43
/
soluciones_airbnb.py
59 lines (31 loc) · 1.09 KB
/
soluciones_airbnb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 16:28:24 2020
@author: hp
"""
import numpy as np
import pandas as pd
airbnb = pd.read_csv("RUTA DONDE GUARDASTE TU ARCHIVO/airbnb_cdmx.csv")
print(airbnb.head())
#%%
print(airbnb.columns)
#%%
problema_2 = airbnb[(airbnb["id"] == 43856289) | (airbnb["id"] == 107078)]
#%%
'''
minimo_noches_disponibles == 6
Num_habitaciones >= 2
Num_criticas > 10
puntuacion > 4
Se debe ordenar de mayor a menor puntuacion. En caso de empate, ordenar por
num_criticas descendiente
'''
alicia = airbnb[((airbnb["maximum_nights"] >= 6) & (airbnb["minimum_nights"] <=6)) \
& (airbnb["bedrooms"] >=2) & (airbnb["number_of_reviews"] > 10) \
& (airbnb["review_scores_accuracy"] > 4)].sort_values(by = ["review_scores_accuracy","number_of_reviews"], \
ascending = [False,False])
problema2 = alicia.head(round(alicia.shape[0]/3))
df = airbnb[(airbnb["maximum_nights"] < 5) & (airbnb["minimum_nights"] >= 3)]
'''
6 esté en [min,max]
'''