NumPy

import numpy

Create Array

mylist = [1,2,3]
myarray = numpy.array(mylist)
print(myarray)
[1 2 3]
print(myarray.shape)
(3,)

Access Data

mylist = [[1,2,3], [4,5,6]]
myarray = numpy.array(mylist)
print(myarray)
[[1 2 3]
 [4 5 6]]
print(myarray.shape)
(2, 3)
print(f'First row is: {myarray[0]}')
First row is: [1 2 3]
print(f'Last row is: {myarray[-1]}')
Last row is: [4 5 6]
print(f'An element at specific row {0} and col {2} is: {myarray[0,2]}')
An element at specific row 0 and col 2 is: 3
print(f'Whole col {2} is: {myarray[:,2]}')
Whole col 2 is: [3 6]

Arithmetic

array1 = numpy.array([2,3,4])
array2 = numpy.array([5,6,7])
print(f'Adding two arrays: {array1 + array2}')
Adding two arrays: [ 7  9 11]
print(f'Multiplying two arrays: {array1*array2}')
Multiplying two arrays: [10 18 28]