Python: NumPy basic functions

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/40

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

41 Terms

1
New cards

array()

creates a NumPy array from a list or iterable

2
New cards

arange()

returns evenly spaced values within a given range

3
New cards

linspace()

returns evenly spaced numbers over a specified interval

4
New cards

zeros()

creates an array filled with zeros

5
New cards

ones()

creates an array filled with ones

6
New cards

empty()

creates an array without initializing entries (fast, random values inside)

7
New cards

full()

creates an array filled with a given value

8
New cards

eye()

creates an identity matrix

9
New cards

reshape()

changes the shape of an array without changing its data

10
New cards

ravel()

flattens an array into 1D

11
New cards

flatten()

returns a copy of the array flattened into 1D

12
New cards

transpose()

transposes the dimensions of an array

13
New cards

concatenate()

joins arrays along an existing axis

14
New cards

stack()

stacks arrays along a new axis

15
New cards

split()

splits an array into multiple sub-arrays

16
New cards

copy()

returns a copy of an array

17
New cards

dtype()

returns the data type of an array

18
New cards

sum()

returns the sum of array elements

19
New cards

mean()

returns the average of array elements

20
New cards

median()

returns the median of array elements

21
New cards

std()

returns the standard deviation of array elements

22
New cards

var()

returns the variance of array elements

23
New cards

min()

returns the minimum value in an array

24
New cards

max()

returns the maximum value in an array

25
New cards

argmin()

returns the index of the minimum value

26
New cards

argmax()

returns the index of the maximum value

27
New cards

dot()

computes the dot product of two arrays

28
New cards

matmul()

matrix multiplication of two arrays

29
New cards

cross()

returns the cross product of two vectors

30
New cards

inv()

returns the inverse of a matrix

31
New cards

det()

returns the determinant of a matrix

32
New cards

eig()

returns the eigenvalues and eigenvectors of a matrix

33
New cards

where()

returns indices where condition is true

34
New cards

nonzero()

returns indices of non-zero elements

35
New cards

unique()

returns unique elements of an array

36
New cards

sort()

sorts an array

37
New cards

argsort()

returns indices that would sort an array

38
New cards

random.rand()

generates an array of random numbers (uniform distribution)

39
New cards

random.randn()

generates random numbers (normal distribution)

40
New cards

random.randint()

generates random integers in a range

41
New cards

random.choice()

randomly selects elements from an arrayy