@@ -15,47 +15,47 @@ class TestGeoMapper:
1515 fips_data = pd .DataFrame (
1616 {
1717 "fips" : ["01123" , "02340" , "98633" , "18181" ],
18- "date " : [pd .Timestamp ("2018-01-01" )] * 4 ,
18+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 4 ,
1919 "count" : [2 , 0 , 20 , 10021 ],
2020 "total" : [4 , 0 , 400 , 100001 ],
2121 }
2222 )
2323 fips_data_2 = pd .DataFrame (
2424 {
2525 "fips" : ["01123" , "02340" , "02002" , "18633" , "18181" ],
26- "date " : [pd .Timestamp ("2018-01-01" )] * 5 ,
26+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 5 ,
2727 "count" : [2 , 1 , 20 , np .nan , 10021 ],
2828 "total" : [4 , 1 , 400 , np .nan , 100001 ],
2929 }
3030 )
3131 fips_data_3 = pd .DataFrame (
3232 {
3333 "fips" : ["48059" , "48253" , "48441" , "72003" , "72005" , "10999" ],
34- "date " : [pd .Timestamp ("2018-01-01" )] * 3 + [pd .Timestamp ("2018-01-03" )] * 3 ,
34+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 3 + [pd .Timestamp ("2018-01-03" )] * 3 ,
3535 "count" : [1 , 2 , 3 , 4 , 8 , 5 ],
3636 "total" : [2 , 4 , 7 , 11 , 100 , 10 ],
3737 }
3838 )
3939 fips_data_4 = pd .DataFrame (
4040 {
4141 "fips" : ["01123" , "48253" , "72003" , "18181" ],
42- "date " : [pd .Timestamp ("2018-01-01" )] * 4 ,
42+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 4 ,
4343 "count" : [2 , 1 , np .nan , 10021 ],
4444 "total" : [4 , 1 , np .nan , 100001 ],
4545 }
4646 )
4747 fips_data_5 = pd .DataFrame (
4848 {
4949 "fips" : [1123 , 48253 , 72003 , 18181 ],
50- "date " : [pd .Timestamp ("2018-01-01" )] * 4 ,
50+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 4 ,
5151 "count" : [2 , 1 , np .nan , 10021 ],
5252 "total" : [4 , 1 , np .nan , 100001 ],
5353 }
5454 )
5555 zip_data = pd .DataFrame (
5656 {
5757 "zip" : ["45140" , "95616" , "95618" ] * 2 ,
58- "date " : [pd .Timestamp ("2018-01-01" )] * 3 + [pd .Timestamp ("2018-01-03" )] * 3 ,
58+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 3 + [pd .Timestamp ("2018-01-03" )] * 3 ,
5959 "count" : [99 , 345 , 456 , 100 , 344 , 442 ],
6060 }
6161 )
@@ -66,15 +66,15 @@ class TestGeoMapper:
6666 pd .DataFrame (
6767 {
6868 "fips" : ["01001" ] * len (jan_month ),
69- "date " : jan_month ,
69+ "timestamp " : jan_month ,
7070 "count" : np .arange (len (jan_month )),
7171 "visits" : np .arange (len (jan_month )),
7272 }
7373 ),
7474 pd .DataFrame (
7575 {
7676 "fips" : ["01002" ] * len (jan_month ),
77- "date " : jan_month ,
77+ "timestamp " : jan_month ,
7878 "count" : np .arange (len (jan_month )),
7979 "visits" : 2 * np .arange (len (jan_month )),
8080 }
@@ -86,15 +86,15 @@ class TestGeoMapper:
8686 pd .DataFrame (
8787 {
8888 "fips" : ["01001" ] * len (jan_month ),
89- "date " : jan_month ,
89+ "timestamp " : jan_month ,
9090 "count" : np .arange (len (jan_month )),
9191 "_thr_col_roll" : np .arange (len (jan_month )),
9292 }
9393 ),
9494 pd .DataFrame (
9595 {
9696 "fips" : [11001 ] * len (jan_month ),
97- "date " : jan_month ,
97+ "timestamp " : jan_month ,
9898 "count" : np .arange (len (jan_month )),
9999 "_thr_col_roll" : np .arange (len (jan_month )),
100100 }
@@ -112,7 +112,7 @@ class TestGeoMapper:
112112 84000013 ,
113113 84090002 ,
114114 ],
115- "date " : [pd .Timestamp ("2018-01-01" )] * 3
115+ "timestamp " : [pd .Timestamp ("2018-01-01" )] * 3
116116 + [pd .Timestamp ("2018-01-03" )] * 3
117117 + [pd .Timestamp ("2018-01-01" )],
118118 "count" : [1 , 2 , 3 , 4 , 8 , 5 , 20 ],
@@ -245,7 +245,7 @@ def test_add_geocode(self, geomapper):
245245 new_data ,
246246 pd .DataFrame ().from_dict (
247247 {
248- "date " : {0 : pd .Timestamp ("2018-01-01 00:00:00" )},
248+ "timestamp " : {0 : pd .Timestamp ("2018-01-01 00:00:00" )},
249249 "NATION" : {0 : "us" },
250250 "count" : {0 : 10024.0 },
251251 "total" : {0 : 100006.0 },
@@ -259,7 +259,7 @@ def test_add_geocode(self, geomapper):
259259 new_data ,
260260 pd .DataFrame ().from_dict (
261261 {
262- "date " : {
262+ "timestamp " : {
263263 0 : pd .Timestamp ("2018-01-01" ),
264264 1 : pd .Timestamp ("2018-01-03" ),
265265 },
@@ -280,7 +280,7 @@ def test_add_geocode(self, geomapper):
280280 assert geomapper .add_geocode (self .fips_data_3 , "fips" , "hrr" , dropna = False ).isna ().any ().any ()
281281
282282 # fips -> zip (date_col=None chech)
283- new_data = geomapper .replace_geocode (self .fips_data_5 .drop (columns = ["date " ]), "fips" , "hrr" , date_col = None )
283+ new_data = geomapper .replace_geocode (self .fips_data_5 .drop (columns = ["timestamp " ]), "fips" , "hrr" , date_col = None )
284284 pd .testing .assert_frame_equal (
285285 new_data ,
286286 pd .DataFrame ().from_dict (
@@ -293,7 +293,7 @@ def test_add_geocode(self, geomapper):
293293 )
294294
295295 # fips -> hhs
296- new_data = geomapper .replace_geocode (self .fips_data_3 .drop (columns = ["date " ]),
296+ new_data = geomapper .replace_geocode (self .fips_data_3 .drop (columns = ["timestamp " ]),
297297 "fips" , "hhs" , date_col = None )
298298 pd .testing .assert_frame_equal (
299299 new_data ,
@@ -313,7 +313,7 @@ def test_add_geocode(self, geomapper):
313313 new_data ,
314314 pd .DataFrame ().from_dict (
315315 {
316- "date " : {0 : pd .Timestamp ("2018-01-01" ), 1 : pd .Timestamp ("2018-01-01" ),
316+ "timestamp " : {0 : pd .Timestamp ("2018-01-01" ), 1 : pd .Timestamp ("2018-01-01" ),
317317 2 : pd .Timestamp ("2018-01-03" ), 3 : pd .Timestamp ("2018-01-03" )},
318318 "hhs" : {0 : "5" , 1 : "9" , 2 : "5" , 3 : "9" },
319319 "count" : {0 : 99.0 , 1 : 801.0 , 2 : 100.0 , 3 : 786.0 },
0 commit comments