1. Array
1?? and list
First introduce
From array Import array
The list is then passed directly to the array parameter into the constructor. (I don't know if it's called a constructor)
Np.array (' d ', [+])
Turn back then call the ToList function
_.tolist ()
2?? Enumerations & Common Methods
Array Use method:
Type code C type Minimum size in bytes
' C ' character 1
' B ' signed integer 1
' B ' unsigned integer 1
' U ' Unicode character 2
' H ' signed integer 2
' H ' unsigned integer 2
' I ' signed integer 2
' I ' unsigned integer 2
' L ' signed integer 4
' L ' unsigned integer 4
' F ' floating point 4
' d ' floating point 8
From array Import *
Create an array of type Interger
Myarr = Array ("L") <--------Creating arrays
Myarr.append (3) <----------------append elements
Myarr.append (1)
Myarr.append (8)
Delete Last
Myarr.pop ()
Deletes the first specified x
Myarr.remove (x)
Take the value of the array ..... by subscript
NUM1 = Myarr[0] <-----------first value
Specify the location, .... Inserting values
Myarr.insert (6,10) 6 means subscript .... 10 indicates the value to insert
Array reverse order .....
Myarr.reverse ()
"Python" "sequence"