0% found this document useful (0 votes)
65 views1 page

Essential NumPy Array Methods Guide

Uploaded by

rameise22123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views1 page

Essential NumPy Array Methods Guide

Uploaded by

rameise22123
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Most Commonly Used NumPy Array Methods

Method Description

ndim Number of dimensions


shape Gives (rows, columns) of the array
dtype Data type of array elements
reshape() Change the shape of array
flatten() Convert multi-dimensional array to 1D
ravel() Flatten the array (returns a view if possible)
transpose() Flip rows and columns
sum() Sum of elements
mean() Average of elements
max() Maximum value
min() Minimum value
argmax() Index of maximum value
argmin() Index of minimum value
sort() Sort the elements
astype() Change data type of array elements
copy() Create a deep copy of array
tolist() Convert array to Python list

You might also like