-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbitcoinChallenge.html
34 lines (30 loc) · 2.19 KB
/
bitcoinChallenge.html
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
<!DOCTYPE html>
<html>
<head>
<title>Bit coin challenge</title>
<link rel="stylesheet" type="text/css" href="bitcoinChallenge.css">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700,500' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.css">
<!-- <script type="text/javascript" src="assets/js/lib/jquery-2.1.4.min.js"></script> -->
</head>
<body>
<div id="container">
<h1>To-Do List <i class="fa fa-plus"></i></h1>
Run Code End Code Save Start Over Theme
Big Data
Using Higher Order Functions to Reduce Large Amounts of Data
Let's use higher order functions like map, filter, and reduce to gather information and manipulate some data. Here we are importing historical Bitcoin data from 2013 to 2015. Each object contains information like price, market cap, fees, and much more. Let’s see what information we can extract using higher order functions!
<ol>
To begin scroll down to line 8034 - click and drag the scrollbar that appears on the right as you begin scrolling to get there quickly.
<li>First, let's log the bitcoinData object to investigate the structure of our data.</li>
<li>What is the data type of bitcoinData? Let’s say we just want to look at bitcoin information on May 1st, 2013. How can we do that?</li>
<li>Let’s say we want to create an array containing only the date and price of each day. Use the built-in map method to create an array containing that information.</li>
<li>Let’s create an array that only includes days when exchange volume was not 0. Which method should we use?</li>
<li>Everyday, new Bitcoins are generated. If we want to find out how many were generated all together during the time that’s provided in the dataset, can you figure out how to calculate it using reduce?</li>
<li>Bitcoin price fluctuates a lot. Let’s combine some array methods to find the total number of days when bitcoin price was over $100!</li>
<li>And finally, let’s find the average bitcoin transaction fees between 2013 and 2015. Be sure to floor this value.</li>
</ol>
</div>
<script type="text/javascript" src="bitcoinChallenge.js"></script>
</body>
</html>