Skip to content

Commit aaa3216

Browse files
committed
Stock_demo data_helper ensure indices are ints before using numpy
1 parent d0f5abf commit aaa3216

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/pylab_examples/data_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def get_two_stock_data():
1717
file2 = cbook.get_sample_data('AAPL.dat.gz')
1818
M1 = fromstring(file1.read(), '<d')
1919

20-
M1 = resize(M1, (M1.shape[0]/2, 2))
20+
M1 = resize(M1, (int(M1.shape[0]/2), 2))
2121

2222
M2 = fromstring(file2.read(), '<d')
23-
M2 = resize(M2, (M2.shape[0]/2, 2))
23+
M2 = resize(M2, (int(M2.shape[0]/2), 2))
2424

2525
d1, p1 = M1[:, 0], M1[:, 1]
2626
d2, p2 = M2[:, 0], M2[:, 1]

0 commit comments

Comments
 (0)