In [1]:
l1=[1,2,3,4]
In [2]:
import numpy as np
In [3]:
np.array(l1)
Out[3]:
In [4]:
l1
Out[4]:
In [5]:
a1=np.array(l1)
In [6]:
a1
Out[6]:
In [7]:
l2=[[1,2,3],[4,5,6],[7,8,9]]
In [8]:
l2
Out[8]:
In [9]:
np.array(l2)
Out[9]:
In [10]:
l2
Out[10]:
In [11]:
l2[1]
Out[11]:
In [12]:
l2[1][0]
Out[12]:
In [13]:
l2[1,0]
In [14]:
l2[2][2]
Out[14]:
In [17]:
a2=np.arange(10)
In [18]:
a2
Out[18]:
In [19]:
np.arange(2,5)
Out[19]:
In [20]:
np.arange(0,11,2)
Out[20]:
No comments:
Post a Comment