Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf33c8d3

Browse files
committed
DOC: ensure we only pass ints into np slicing
Fix 3 examples that fail under numpy '1.12.0.dev0+cb7f407'
1 parent81d5a24 commitf33c8d3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
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, (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, (M2.shape[0]//2,2))
2424

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

‎examples/pylab_examples/image_slices_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, ax, X):
1010

1111
self.X=X
1212
rows,cols,self.slices=X.shape
13-
self.ind=self.slices/2
13+
self.ind=self.slices//2
1414

1515
self.im=ax.imshow(self.X[:, :,self.ind])
1616
self.update()

‎examples/pylab_examples/quiver_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
# 6
7676
plt.figure()
7777
M=np.zeros(U.shape,dtype='bool')
78-
M[U.shape[0]/3:2*U.shape[0]/3,
79-
U.shape[1]/3:2*U.shape[1]/3]=True
78+
M[U.shape[0]//3:2*U.shape[0]//3,
79+
U.shape[1]//3:2*U.shape[1]//3]=True
8080
U=ma.masked_array(U,mask=M)
8181
V=ma.masked_array(V,mask=M)
8282
Q=plt.quiver(U,V)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp