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

Skip to content

DOC: ensure we only pass ints into np slicing #7068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
DOC: ensure we only pass ints into np slicing
Fix 3 examples that fail under numpy '1.12.0.dev0+cb7f407'
  • Loading branch information
tacaswell committed Sep 9, 2016
commit f33c8d33c65bed067e445f57c20a4b7c9acb04dc
4 changes: 2 additions & 2 deletions examples/pylab_examples/data_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def get_two_stock_data():
file2 = cbook.get_sample_data('AAPL.dat.gz')
M1 = fromstring(file1.read(), '<d')

M1 = resize(M1, (M1.shape[0]/2, 2))
M1 = resize(M1, (M1.shape[0]//2, 2))

M2 = fromstring(file2.read(), '<d')
M2 = resize(M2, (M2.shape[0]/2, 2))
M2 = resize(M2, (M2.shape[0]//2, 2))

d1, p1 = M1[:, 0], M1[:, 1]
d2, p2 = M2[:, 0], M2[:, 1]
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/image_slices_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, ax, X):

self.X = X
rows, cols, self.slices = X.shape
self.ind = self.slices/2
self.ind = self.slices//2

self.im = ax.imshow(self.X[:, :, self.ind])
self.update()
Expand Down
4 changes: 2 additions & 2 deletions examples/pylab_examples/quiver_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
# 6
plt.figure()
M = np.zeros(U.shape, dtype='bool')
M[U.shape[0]/3:2*U.shape[0]/3,
U.shape[1]/3:2*U.shape[1]/3] = True
M[U.shape[0]//3:2*U.shape[0]//3,
U.shape[1]//3:2*U.shape[1]//3] = True
U = ma.masked_array(U, mask=M)
V = ma.masked_array(V, mask=M)
Q = plt.quiver(U, V)
Expand Down