pandas dataframes can be treated as ndarrays

ndarraysndarray directlySlicing is done with colon, starting with the outer array to the inner
To get a specific set of rows and columns:
subset_array = ndarray[start_row:end_row+1, start_col:end_col+1] # Add 1 as upper is exclusive
# Example
ndarray[0:3, 1:3] # Get the first 3 rows, and 2nd and 3rd column
Create arrays with:
np.array([2.3.4])np.array([(2,3,4),(5,6,7)])np.empty)Add dimensions by specifying more numbers
e.g., 3D empty array: np.empty((5,4,3)) - Depth of 5, 4 rows, 3 columns
It does not give an empty array, but shows what ever values were present in corresponding memory location

Possible empty array values
np.zeros)np.zeros insteadnp.ones((5,4), dtype=int) # Use dtype to specify
Create random arrays with:
To ensure that arrays are generated consistently, define a seed with np.random.seed(<ANY NUMBER>)
# Generate an array full of random numbers, uniformly samples from [0.0, 1.0)
np.random.random((5, 4)) # pass in a size tuple
# Generate an array full of random numbers, uniformly samples from [0.0, 1.0)
np.random.rand(5, 4) # function arguments (not a tuple)
# Sample numbers from a Gaussian (normal) distribution
np.random.normal(size=(2, 3)) # "standard normal" (mean = 0, s.d. = 1)
# Sample numbers from a Gaussian (normal) distribution
np.random.normal(50, 10, size=(2, 3)) # change mean to 50 and s.d. to 10
# Random integers
np.random.randint(1) # a single integer in [0, 10)
np.random.randint(0, 10) # same as above, specifying [low, high) explicit
np.random.randint(0, 10, size=5) # 5 random integers as a 1D array
np.random.randint(0, 10, size=(2, 3)) # 2x3 array of random integers
<aside> 📌 SUMMARY: Numpy arrays are similar to dataframes, and can perform a series of operations stated above
</aside>