- Hands-On Python Deep Learning for the Web
- Anubhav Singh Sayak Paul
- 66字
- 2021-06-24 16:23:29
NumPy arrays
There are several methods to create arrays in NumPy. The following are some notable ones:
- np.array: To convert Python lists to NumPy arrays:
- np.ones or np.zeros: To create a NumPy array of all 1s or all 0s:
- np.random.rand: To generate an array of random numbers:
- np.eye: To generate an identity matrix of given square matrix dimensions:
Let's now look at basic NumPy array operations.