-
Notifications
You must be signed in to change notification settings - Fork 0
/
New Text Document.txt
115 lines (67 loc) · 2.36 KB
/
New Text Document.txt
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
Analysis -
1. Handling null values
2. Growth analysis
3. Location analysis - airbnb's concentration in Asheville
4. Price analysis - Expensive, Reasons for cost(Close to attractions/bigger rentals)
5. Seasonality analysis
6. Superhost analysis
7. Review analysis
1. Handling null values -
Perform an analysis on missing values for interested columns
Plot a missing values plot
Replace the null values with zero for numeric columns (as we will we performing statistical analysis)
2.Growth analysis:
A single host can have multiple listings in Airbnb. As the number of listings is an indication of growth,
we have taken the listings count as such.
Total number of listings per year
Number of new listing per year
Unique host count
3.Location analysis - airbnb's concentration in Asheville
Concentration of listings in area
************************************************************************************
// var lat_lng = [];
// d3.csv('static/data/listings_details.csv').then((data) =>{
// console.log(data);
// //console.log(lat_lng);
// var latitude = data.map(row => row.latitude);
// var longitude = data.map(row => row.longitude);
// // var lat_lng
// // console.log(latitude);
// // console.log(longitude);
// // for(var i=0;i<)
// for(var i=0; i<data.length; i++)
// {
// //latitude[i].push(lat_lng['latitude']);
// //lat_lng['latitude'].append(latitude[i]);
// lat_lng.push({
// key: "Latitude",
// value: latitude[i],
// key: "Longitude",
// value: longitude[i]
// })
****************************************************************************************
function createFeature(features)
{
var myMap = L.map("all_listing_map", {
center: [35.6010, -82.5540],
zoom: 13
});
function createFeature(geojsonData){
var geolayer = L.geojson(geojsonData);
createMap(geolayer);
}
function createMap(geolayer){
L.tileLayer("https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
tileSize: 512,
maxZoom: 18,
zoomOffset: -1,
id: "mapbox/streets-v11",
accessToken: api_key
}).addTo(myMap);
}
}
// Adding a tile layer (the background map image) to our map
d3.csv('static/data/neighbourhoods.geojson').then((data) =>{
console.log(data);
createFeature(data.features);
});