File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 88###################################################################################################
99###################################################################################################
1010
11+ def unlog (arr , base = 10 ):
12+ """Helper function to unlog an array.
13+
14+ Parameters
15+ ----------
16+ arr : ndarray
17+ Array.
18+ base : float
19+ Base of the log to undo.
20+
21+ Returns
22+ -------
23+ ndarray
24+ Unlogged array.
25+ """
26+
27+ return np .power (base , arr )
28+
29+
1130def group_three (vec ):
1231 """Group an array of values into threes.
1332
Original file line number Diff line number Diff line change 1212###################################################################################################
1313###################################################################################################
1414
15+ def test_unlog ():
16+
17+ orig = np .array ([1 , 2 , 3 , 4 ])
18+ logged = np .log10 (orig )
19+ unlogged = unlog (logged )
20+ assert np .array_equal (orig , unlogged )
21+
1522def test_group_three ():
1623
1724 dat = [0 , 1 , 2 , 3 , 4 , 5 ]
You can’t perform that action at this time.
0 commit comments