Jul 18, 2024
Contiguous Memory Allocation:
Implemented in Multiple Languages:
import numpy as np
This command lets the computer know that Numpy library functions will be used.arr = np.array([1, 2, 3, 4, 5])
print(arr)
np.array()
creates an array with the given elements.arr
will display the array elements.numpy
can be alias to shorten and simplify the code.import numpy as np
,
np
becomes a shorthand to reference the Numpy library.np.array()
instead of numpy.array()
.print(np.__version__)