-
Notifications
You must be signed in to change notification settings - Fork 1
/
numpy.py
27 lines (23 loc) · 1.15 KB
/
numpy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# NUMPY CHEATSHEET
#Importing the library
import numpy as np
1. np.array() # Create a numpy array from a Python list or tuple
2. np.arrange() # Makes evenly spaced array within a given range
3. np.zeros() # Create an array filled with zeros
4. np.ones() # Create an array filled with ones
5. np.linspace() # Evenly spaced numbers over a specified range
6. np.reshape() # Reshape an array into a new shape
7. np.random.rand() # Array of random numbers from an uniform distribution
8. np.sum() # Compute the sum of array elements
9. np.mean() # Compute the mean of array elements
10. np.argmax() # Find the index of max value in an array
11. np.argmin() # Find the index of min value in an array
12. np.max() # Find the maximum value in an array
13. np.min() # Find the minimum value in an array
14. np.dot() # Compute the dot product of two arrays
15. np.transponse() # Transponse an array
16. np.concatanate() # Concatanate arrays along a specified axis
17. np.vstack() # Stack arrays vertically (row-wise)
18. np.hstack() # Stack arrays horinzontally (column-wise)
19. np.split() # Split an array into multiple sub-arrays
20. np.unique() # Find the unique elements of an array