-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSource code
272 lines (211 loc) · 10.8 KB
/
Source code
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
Colab share code
CODE:
import pandas as pd
import folium
hotels = pd.read_csv("Hotels.csv")
places = pd.read_csv("Places.csv")
types = pd.read_csv("Typess.csv")
hotels.head()
cut_labels = ['Low','Moderate','High']
hotels['Budget'] = pd.qcut(hotels['PRICE_RUPEES'][hotels['PRICE_RUPEES']>0],q=[0,.25, .75, 1], labels=cut_labels).astype("object")
hotels['Popularity'] = pd.qcut(hotels['NUMBER_OF_REVIEWS'][hotels['NUMBER_OF_REVIEWS']>0],q=[0,.25, .75, 1], labels=cut_labels).astype("object")
hotels.head()
hotels['Budget'].value_counts()
import pandas as pd
import folium
# Load hotel data
hotels = pd.read_csv("Hotels.csv") #Staying recommandadtion
# Define labels for budget and popularity
cut_labels = ['Low', 'Moderate', 'High']
# Categorize hotels based on budget and popularity
hotels['Budget'] = pd.qcut(hotels['PRICE_RUPEES'][hotels['PRICE_RUPEES'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
hotels['Popularity'] = pd.qcut(hotels['NUMBER_OF_REVIEWS'][hotels['NUMBER_OF_REVIEWS'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
# Define the location of the map
Jaipur_location = [26.9124, 75.7873]
print("You can refer and type the budget levels from above!")
p = str(input("Enter your budget: "))
# Create the map
Jaipur_map = folium.Map(location=Jaipur_location, zoom_start=12, tiles='openstreetmap')
# Define icons for different types of hotels
icon_map = {
"Low": "bed",
"Moderate": "building",
"High": "suitcase"
}
# Loop through each hotel and add a marker to the map
for lat, lon, name, price, popularity, budget in zip(hotels['Lat'], hotels['Lng'], hotels['HOTEL'], hotels['PRICE_RUPEES'], hotels['Popularity'], hotels['Budget']):
# Select an icon based on the hotel's popularity
#icon_name = icon_map[popularity]
#icon_name2= icon_map["cutlery"]
# Add a marker to the map with the appropriate icon and popup message
folium.Marker([lat, lon],
radius=10,
popup='<strong>Hotel:</strong> ' + str(name) + '<br>' +
'<strong>Price:</strong> ' + str(price) + '<br>' +
'<strong>Popularity:</strong> ' + str(popularity) + '<br>',
icon=folium.Icon(color="blue", icon="hotel", prefix='fa')
).add_to(Jaipur_map)
# Display the map
Jaipur_map
icon=folium.Icon(color="red",icon="hotel", prefix='fa')
import pandas as pd
import folium
# Load hotel data
hotels = pd.read_csv("Hotels.csv") #Staying recommandadtion
# Define labels for budget and popularity
cut_labels = ['Low', 'Moderate', 'High']
# Categorize hotels based on budget and popularity
hotels['Budget'] = pd.qcut(hotels['PRICE_RUPEES'][hotels['PRICE_RUPEES'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
hotels['Popularity'] = pd.qcut(hotels['NUMBER_OF_REVIEWS'][hotels['NUMBER_OF_REVIEWS'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
# Define the location of the map
Jaipur_location = [26.9124, 75.7873]
# Create the map
Jaipur_map = folium.Map(location=Jaipur_location, zoom_start=12, tiles='openstreetmap')
# Define icons for different types of hotels
icon_map = {
"Low": "bed",
"Moderate": "building",
"High": "suitcase"
}
# Loop through each hotel and add a marker to the map
for lat, lon, name, price, popularity, budget in zip(hotels['Lat'], hotels['Lng'], hotels['HOTEL'], hotels['PRICE_RUPEES'], hotels['Popularity'], hotels['Budget']):
# Select an icon based on the hotel's popularity
icon_name = icon_map[popularity]
# Add a marker to the map with the appropriate icon and popup message
folium.Marker([lat, lon],
radius=10,
popup='<strong>Hotel:</strong> ' + str(name) + '<br>' +
'<strong>Price:</strong> ' + str(price) + '<br>' +
'<strong>Popularity:</strong> ' + str(popularity) + '<br>',
icon=folium.Icon(color="red", icon=icon_name, prefix='fa')
).add_to(Jaipur_map)
# Display the map
Jaipur_map
import pandas as pd
import folium
# Load hotel data
hotels = pd.read_csv("Hotels.csv") #Staying recommandadtion
# Define labels for budget and popularity
cut_labels = ['Low', 'Moderate', 'High']
# Categorize hotels based on budget and popularity
hotels['Budget'] = pd.qcut(hotels['PRICE_RUPEES'][hotels['PRICE_RUPEES'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
hotels['Popularity'] = pd.qcut(hotels['NUMBER_OF_REVIEWS'][hotels['NUMBER_OF_REVIEWS'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
# Define the location of the map
Jaipur_location = [26.9124, 75.7873]
# Create the map
Jaipur_map = folium.Map(location=Jaipur_location, zoom_start=12, tiles='openstreetmap')
# Define icons for different types of hotels
icon_map = {
"Low": "bed",
"Moderate": "building",
"High": "suitcase"
}
# Loop through each hotel and add a marker to the map
for lat, lon, name, price, popularity, budget in zip(hotels['Lat'], hotels['Lng'], hotels['HOTEL'], hotels['PRICE_RUPEES'], hotels['Popularity'], hotels['Budget']):
# Select an icon based on the hotel's popularity
icon_name = icon_map[popularity]
# Add a marker to the map with the appropriate icon and popup message
folium.Marker([lat, lon],
radius=10,
popup='<strong>Hotel:</strong> ' + str(name) + '<br>' +
'<strong>Price:</strong> ' + str(price) + '<br>' +
'<strong>Popularity:</strong> ' + str(popularity) + '<br>',
icon=folium.Icon(color="blue", icon=icon_name, prefix='fa')
).add_to(Jaipur_map)
# Display the map
Jaipur_map
import pandas as pd
import folium
# Load hotel data
hotels = pd.read_csv("Hotels.csv") #Staying recommandadtion
# Define labels for budget and popularity
cut_labels = ['Low', 'Moderate', 'High']
# Categorize hotels based on budget and popularity
hotels['Budget'] = pd.qcut(hotels['PRICE_RUPEES'][hotels['PRICE_RUPEES'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
hotels['Popularity'] = pd.qcut(hotels['NUMBER_OF_REVIEWS'][hotels['NUMBER_OF_REVIEWS'] > 0], q=[0, .25, .75, 1], labels=cut_labels).astype("object")
# Define the location of the map
Jaipur_location = [26.9124, 75.7873]
# Create the map
Jaipur_map = folium.Map(location=Jaipur_location, zoom_start=12, tiles='openstreetmap')
# Define icons for different types of hotels
icon_map = {
"Low": "bed",
"Moderate": "building",
"High": "suitcase"
}
# Loop through each hotel and add a marker to the map
for lat, lon, name, price, popularity, budget in zip(hotels['Lat'], hotels['Lng'], hotels['HOTEL'], hotels['PRICE_RUPEES'], hotels['Popularity'], hotels['Budget']):
# Select an icon based on the hotel's popularity
#icon_name = icon_map[popularity]
#icon_name2= icon_map["cutlery"]
# Add a marker to the map with the appropriate icon and popup message
folium.Marker([lat, lon],
radius=10,
popup='<strong>Hotel:</strong> ' + str(name) + '<br>' +
'<strong>Price:</strong> ' + str(price) + '<br>' +
'<strong>Popularity:</strong> ' + str(popularity) + '<br>',
icon=folium.Icon(color="blue", icon="cutlery", prefix='fa')
).add_to(Jaipur_map)
# Display the map
Jaipur_map
print("You can refer and type the budget levels from above!")
p = str(input("Enter your budget: "))
data = hotels[hotels['Budget'] == p]
jaipur_map = folium.Map(location=[26.9124, 75.7873], zoom_start=12,tiles='openstreetmap')
for lat, lon, name, price, popularity in zip(data['Lat'], data['Lng'], data['HOTEL'],data['PRICE_RUPEES'],data['Popularity']):
folium.Marker([lat, lon],
radius=10,
popup = ('<strong>Hotel</strong>: ' + str(name) + '<br>'
'<strong>Price</strong>: ' + str(price) + '<br>'
'<strong>Popularity</strong>: ' + str(popularity) + '<br>'),
icon=folium.Icon(color='purple',icon="glass", prefix='fa')).add_to(jaipur_map)
jaipur_map
df = pd.merge(places, types , on=["PID",'POIs'])
df.head()
df['PRIORITY_1'].value_counts()
print("You can refer and type the priorities from above!")
p = str(input("Enter your priority: "))
data = df[df['PRIORITY_5'] == p]
logo_url = 'https://hips.hearstapps.com/delish/assets/17/31/1501791674-delish-chicken-curry-horizontal.jpg'
jaipur_map = folium.Map(location=[26.9124, 75.7873], zoom_start=12,tiles='openstreetmap')
for lat, lon, name, intime1, outtime1,intime2, outtime2 in zip(data['LATITUDE'], data['LONGITUDE'], data['POIs'],data['IN-TIME1'],data['OUT-TIME1'],data['IN-TIME2'],data['OUT-TIME2']):
icon = folium.features.CustomIcon(logo_url,\
icon_size=(50,50))
folium.Marker([lat, lon],
radius=10,
popup = ('<strong>Place</strong>: ' + str(name) + '<br>'
'<strong>In Time 1</strong>: ' + str(intime1) + '<br>'
'<strong>Out Time 1</strong>: ' + str(outtime1) + '<br>'
'<strong>In Time 2</strong>: ' + str(intime2) + '<br>'
'<strong>Out Time 2</strong>: ' + str(outtime2) + '<br>'),
icon= icon).add_to(jaipur_map)
jaipur_map
print("You can refer and type the priorities from above!")
p = str(input("Enter your priority: "))
data = df[df['PRIORITY_1'] == p]
logo_url = 'https://www.makemytrip.com/travel-guide/media/dg_image/jaipur/thumb/Paragliding_425791_14_jaipur_218_168.jpg'
jaipur_map = folium.Map(location=[26.9124, 75.7873], zoom_start=12,tiles='openstreetmap')
for lat, lon, name, intime1, outtime1,intime2, outtime2 in zip(data['LATITUDE'], data['LONGITUDE'], data['POIs'],data['IN-TIME1'],data['OUT-TIME1'],data['IN-TIME2'],data['OUT-TIME2']):
icon = folium.features.CustomIcon(logo_url,\
icon_size=(50,50))
folium.Marker([lat, lon],
radius=10,
popup = ('<strong>Place</strong>: ' + str(name) + '<br>'
'<strong>In Time 1</strong>: ' + str(intime1) + '<br>'
'<strong>Out Time 1</strong>: ' + str(outtime1) + '<br>'
'<strong>In Time 2</strong>: ' + str(intime2) + '<br>'
'<strong>Out Time 2</strong>: ' + str(outtime2) + '<br>'),
icon= icon).add_to(jaipur_map)
jaipur_map
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('dark_background')
df=pd.read_csv('Hotels.csv')
df
df.info()
df.duplicated().sum()
df.head()
plt.figure(figsize=(16,8))
sns.lineplot(x='NUMBER_OF_REVIEWS',y='PRICE_RUPEES',data=df)