Skip to content

Commit 97f55b9

Browse files
author
Dieter Vandenbussche
committed
Fix unittest for to_excel with np.int64
1 parent 31ab292 commit 97f55b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/test_frame.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import nose
1212

1313
from numpy import random, nan
14-
from numpy.random import randn
14+
from numpy.random import randn, randint
1515
import numpy as np
1616
import numpy.ma as ma
1717

@@ -2512,11 +2512,11 @@ def test_to_excel_from_excel(self):
25122512
recons = reader.parse('test1')
25132513
assert_frame_equal(self.tsframe, recons)
25142514

2515-
#Test np.int64
2516-
frame = DataFrame(np.random.randn(10,2))
2515+
#Test np.int64, values read come back as float
2516+
frame = DataFrame(np.random.randint(-10,10,size=(10,2)))
25172517
frame.to_excel(path,'test1')
25182518
reader = ExcelFile(path)
2519-
recons = reader.parse('test1')
2519+
recons = reader.parse('test1').astype(np.int64)
25202520
assert_frame_equal(frame, recons)
25212521

25222522
#Test reading/writing np.bool8, roundtrip only works for xlsx

0 commit comments

Comments
 (0)