Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2866887

Browse files
committed
Initialize memory in csv roundtrip test
1 parent 6ada57f commit 2866887

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/tests/test_mlab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def test_colinear_pca():
1313
def test_recarray_csv_roundtrip():
1414
expected = np.recarray((99,),
1515
[('x',np.float),('y',np.float),('t',np.float)])
16-
expected['x'][0] = 1
17-
expected['y'][1] = 2
18-
expected['t'][2] = 3
16+
expected['x'][:] = np.linspace(-1e9, -1, 99)
17+
expected['y'][:] = np.linspace(1, 1e9, 99)
18+
expected['t'][:] = np.linspace(0, 0.01, 99)
1919
fd = tempfile.TemporaryFile(suffix='csv')
2020
mlab.rec2csv(expected,fd)
2121
fd.seek(0)

0 commit comments

Comments
 (0)