In [1]:
import numpy as np
In [7]:
a1 = np.arange(5,25)
In [8]:
a1
Out[8]:
In [9]:
a1
Out[9]:
In [10]:
a1[1]
Out[10]:
In [11]:
a1[:]
Out[11]:
In [13]:
a1[0:5]
Out[13]:
In [14]:
a1[:6]
Out[14]:
In [15]:
a1[4:]
Out[15]:
In [16]:
a1[:-1]
Out[16]:
In [17]:
a1[:-5]
Out[17]:
In [18]:
a1[1:5]=55
In [19]:
a1
Out[19]:
In [20]:
a1[]=55
In [21]:
a1[:]=55
In [22]:
a1
Out[22]:
In [23]:
a1 = np.arange(5,25)
In [24]:
a1
Out[24]:
In [25]:
a2=a1[0:10]
In [26]:
a2
Out[26]:
In [27]:
a2[:5]=55
In [28]:
a2
Out[28]:
In [29]:
a1
Out[29]:
In [30]:
a1 = np.arange(5,25)
In [31]:
a3=a1.copy()
In [32]:
a3
Out[32]:
In [33]:
a3[:4]=20
In [34]:
a3
Out[34]:
In [35]:
a1
Out[35]:
In [38]:
a4=a1[1:6].copy()
In [39]:
a4
Out[39]:
In [41]:
z1= np.array(([5,10,15],[20,25,30],[35,40,45]))
In [42]:
z1
Out[42]:
In [43]:
atwo=np.array(([2,6,7],[3,8,0],[99,33,10]))
In [44]:
atwo
Out[44]:
In [50]:
atwo[1][0]
Out[50]:
In [51]:
atwo[1,0]
Out[51]:
In [52]:
atwo[,0]
In [53]:
atwo[:,2]
Out[53]:
In [54]:
atwo[:,0]
Out[54]:
In [55]:
atwo
Out[55]:
In [58]:
b=atwo[:2,1:]
In [59]:
b
Out[59]:
In [64]:
atwo[:1,2:]
Out[64]:
In [65]:
b=atwo[:2]
In [66]:
atwo[:2]
Out[66]:
In [70]:
atwo[:2,:2]
Out[70]:
Thank you for this post. Good luck.
ReplyDeleteCall Center Software