5
5
import numpy as np
6
6
import pytest
7
7
8
- from pandas .compat import lmap
9
8
from pandas .errors import ParserError
10
9
11
10
import pandas as pd
@@ -120,8 +119,8 @@ def test_to_csv_from_csv3(self):
120
119
df2 .to_csv (path , mode = 'a' , header = False )
121
120
xp = pd .concat ([df1 , df2 ])
122
121
rs = pd .read_csv (path , index_col = 0 )
123
- rs .columns = lmap ( int , rs .columns )
124
- xp .columns = lmap ( int , xp .columns )
122
+ rs .columns = [ int ( label ) for label in rs .columns ]
123
+ xp .columns = [ int ( label ) for label in xp .columns ]
125
124
assert_frame_equal (xp , rs )
126
125
127
126
def test_to_csv_from_csv4 (self ):
@@ -292,15 +291,15 @@ def _to_uni(x):
292
291
if r_dtype :
293
292
if r_dtype == 'u' : # unicode
294
293
r_dtype = 'O'
295
- recons .index = np .array (lmap (_to_uni , recons .index ),
294
+ recons .index = np .array (map (_to_uni , recons .index ),
296
295
dtype = r_dtype )
297
- df .index = np .array (lmap (_to_uni , df .index ), dtype = r_dtype )
296
+ df .index = np .array (map (_to_uni , df .index ), dtype = r_dtype )
298
297
elif r_dtype == 'dt' : # unicode
299
298
r_dtype = 'O'
300
- recons .index = np .array (lmap (Timestamp , recons .index ),
299
+ recons .index = np .array (map (Timestamp , recons .index ),
301
300
dtype = r_dtype )
302
- df .index = np .array (
303
- lmap ( Timestamp , df . index ), dtype = r_dtype )
301
+ df .index = np .array (map ( Timestamp , df . index ),
302
+ dtype = r_dtype )
304
303
elif r_dtype == 'p' :
305
304
r_dtype = 'O'
306
305
recons .index = np .array (
@@ -316,23 +315,23 @@ def _to_uni(x):
316
315
if c_dtype :
317
316
if c_dtype == 'u' :
318
317
c_dtype = 'O'
319
- recons .columns = np .array (lmap (_to_uni , recons .columns ),
318
+ recons .columns = np .array (map (_to_uni , recons .columns ),
320
319
dtype = c_dtype )
321
320
df .columns = np .array (
322
- lmap (_to_uni , df .columns ), dtype = c_dtype )
321
+ map (_to_uni , df .columns ), dtype = c_dtype )
323
322
elif c_dtype == 'dt' :
324
323
c_dtype = 'O'
325
- recons .columns = np .array (lmap (Timestamp , recons .columns ),
324
+ recons .columns = np .array (map (Timestamp , recons .columns ),
326
325
dtype = c_dtype )
327
326
df .columns = np .array (
328
- lmap (Timestamp , df .columns ), dtype = c_dtype )
327
+ map (Timestamp , df .columns ), dtype = c_dtype )
329
328
elif c_dtype == 'p' :
330
329
c_dtype = 'O'
331
330
recons .columns = np .array (
332
- lmap (Timestamp , to_datetime (recons .columns )),
331
+ map (Timestamp , to_datetime (recons .columns )),
333
332
dtype = c_dtype )
334
333
df .columns = np .array (
335
- lmap (Timestamp , df .columns .to_timestamp ()),
334
+ map (Timestamp , df .columns .to_timestamp ()),
336
335
dtype = c_dtype )
337
336
else :
338
337
c_dtype = type_map .get (c_dtype )
0 commit comments