10
10
11
11
12
12
class TestFrameAsof (TestData , tm .TestCase ):
13
-
14
13
def setUp (self ):
15
14
self .N = N = 50
16
15
self .rng = date_range ('1/1/1990' , periods = N , freq = '53s' )
17
16
self .df = DataFrame ({'A' : np .arange (N ), 'B' : np .arange (N )},
18
17
index = self .rng )
19
18
20
19
def test_basic (self ):
21
-
22
20
df = self .df .copy ()
23
21
df .loc [15 :30 , 'A' ] = np .nan
24
22
dates = date_range ('1/1/1990' , periods = self .N * 3 ,
@@ -38,7 +36,6 @@ def test_basic(self):
38
36
self .assertTrue ((rs == 14 ).all (1 ).all ())
39
37
40
38
def test_subset (self ):
41
-
42
39
N = 10
43
40
rng = date_range ('1/1/1990' , periods = N , freq = '53s' )
44
41
df = DataFrame ({'A' : np .arange (N ), 'B' : np .arange (N )},
@@ -96,7 +93,8 @@ def test_all_nans(self):
96
93
97
94
# testing multiple columns
98
95
dates = date_range ('1/1/1990' , periods = self .N * 3 , freq = '25s' )
99
- result = DataFrame (np .nan , index = self .rng , columns = ['A' , 'B' , 'C' ]).asof (dates )
96
+ result = DataFrame (np .nan , index = self .rng ,
97
+ columns = ['A' , 'B' , 'C' ]).asof (dates )
100
98
expected = DataFrame (np .nan , index = dates , columns = ['A' , 'B' , 'C' ])
101
99
tm .assert_frame_equal (result , expected )
102
100
0 commit comments