-
Notifications
You must be signed in to change notification settings - Fork 1
/
pivot.html
66 lines (66 loc) · 2.63 KB
/
pivot.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
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
<html>
<head>
<script src='anim.js'></script>
<script>
window.addEventListener( 'load', function () {
addBoxes(
'First', 1, 0, 0, 1,
'Last', 2, 0, 1, 1, { w1: 2, w2: 2 },
'Day', 4, 0, 1, 0, { w1: 2, w2: 2 },
'', -1000, 0, 0, 0,
'Sales', 6, 0, -1000, 0,
'0', 0, 1, -1000, 0,
'1', 0, 2, -1000, 0,
'2', 0, 3, -1000, 0,
'3', 0, 4, -1000, 0,
'4', 0, 5, -1000, 0,
'5', 0, 6, -1000, 0,
'', -1000, 0, 3, 1, { w2: 2 },
'', -1000, 0, 5, 1, { w2: 2 },
'', -1000, 0, 7, 1, { w2: 2 },
'', 0, 0, -1000, 0,
);
setColor( '#dddddd' );
addBoxes(
'Amy', 1, 1, 0, 2,
'Amy', 1, 2, 0, 2,
'Amy', 1, 3, 0, 2,
'Bob', 1, 4, 0, 3,
'Bob', 1, 5, 0, 3,
'Bob', 1, 6, 0, 3,
);
addBoxes(
'Smith', 2, 1, 1, 2, { w1: 2, w2: 2 },
'Smith', 2, 2, 1, 2, { w1: 2, w2: 2 },
'Smith', 2, 3, 1, 2, { w1: 2, w2: 2 },
'Jones', 2, 4, 1, 3, { w1: 2, w2: 2 },
'Jones', 2, 5, 1, 3, { w1: 2, w2: 2 },
'Jones', 2, 6, 1, 3, { w1: 2, w2: 2 },
);
setColor( '#ddddff' );
addBoxes(
'Monday', 4, 1, 3, 0, { w1: 2, w2: 2 },
'Tuesday', 4, 2, 5, 0, { w1: 2, w2: 2 },
'Wednesday', 4, 3, 7, 0, { w1: 2, w2: 2 },
'Monday', 4, 4, 3, 0, { w1: 2, w2: 2 },
'Tuesday', 4, 5, 5, 0, { w1: 2, w2: 2 },
'Wednesday', 4, 6, 7, 0, { w1: 2, w2: 2 },
);
setColor( '#ddffdd' );
addBoxes(
'39', 6, 1, 3, 2, { w2: 2 },
'68', 6, 2, 5, 2, { w2: 2 },
'10', 6, 3, 7, 2, { w2: 2 },
'93', 6, 4, 3, 3, { w2: 2 },
'85', 6, 5, 5, 3, { w2: 2 },
'0', 6, 6, 7, 3, { w2: 2 },
);
} );
</script>
</head>
<body>
<h1>Pivot</h1>
<pre>df.pivot( index=["First","Last"], columns="Day", values="Sales" )</pre>
<hr/>
</body>
</html>