@@ -4891,14 +4891,17 @@ def make_dtnat_arr(n,nnat=None):
4891
4891
s [- i ] = NaT
4892
4892
s [i ] = NaT
4893
4893
return s
4894
+
4894
4895
# N=35000
4895
4896
s1 = make_dtnat_arr (chunksize + 5 )
4896
4897
s2 = make_dtnat_arr (chunksize + 5 ,0 )
4898
+
4897
4899
# s3=make_dtnat_arr(chunksize+5,0)
4898
- df = DataFrame (dict (a = s1 ,b = s2 ))
4899
- df .to_csv ('/tmp/1.csv' ,chunksize = chunksize )
4900
- recons = DataFrame .from_csv ('/tmp/1.csv' ).convert_objects ('coerce' )
4901
- assert_frame_equal (df , recons ,check_names = False ,check_less_precise = True )
4900
+ with ensure_clean ('1.csv' ) as path :
4901
+ df = DataFrame (dict (a = s1 ,b = s2 ))
4902
+ df .to_csv (path ,chunksize = chunksize )
4903
+ recons = DataFrame .from_csv (path ).convert_objects ('coerce' )
4904
+ assert_frame_equal (df , recons ,check_names = False ,check_less_precise = True )
4902
4905
4903
4906
for ncols in [4 ]:
4904
4907
base = int ((chunksize // ncols or 1 ) or 1 )
@@ -6864,7 +6867,7 @@ def test_replace_convert(self):
6864
6867
df = DataFrame ([['foo' , 'bar' , 'bah' ], ['bar' , 'foo' , 'bah' ]])
6865
6868
m = {'foo' : 1 , 'bar' : 2 , 'bah' : 3 }
6866
6869
rep = df .replace (m )
6867
- expec = Series ([np . int_ , np .int_ , np . int_ ] )
6870
+ expec = Series ([ np .int64 ] * 3 )
6868
6871
res = rep .dtypes
6869
6872
assert_series_equal (expec , res )
6870
6873
@@ -10079,7 +10082,6 @@ def test_insert_column_bug_4032(self):
10079
10082
10080
10083
result = df .rename (columns = {})
10081
10084
str (result )
10082
-
10083
10085
expected = DataFrame ([[1 ,1.1 ],[2 , 2.2 ]],columns = ['a' ,'b' ])
10084
10086
assert_frame_equal (result ,expected )
10085
10087
df .insert (0 , 'c' , [1.3 , 2.3 ])
0 commit comments