[go: up one dir, main page]

0% found this document useful (0 votes)
40 views5 pages

Numpyarrar

This document provides an overview of key NumPy array concepts and operations including: creating 1D and 2D arrays; converting between array dimensions; indexing and slicing arrays; creating views versus copies of arrays; performing scalar, relational, logical, and statistical operations on arrays; sorting arrays; and broadcasting operations between arrays of different sizes.

Uploaded by

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

Numpyarrar

This document provides an overview of key NumPy array concepts and operations including: creating 1D and 2D arrays; converting between array dimensions; indexing and slicing arrays; creating views versus copies of arrays; performing scalar, relational, logical, and statistical operations on arrays; sorting arrays; and broadcasting operations between arrays of different sizes.

Uploaded by

Ritesh Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

NumPy Array

Creating
1D array

Creating
2D array

To convert
1D to 2D
and 2D to
1D

To convert
row vector
to column
vector
To find the
dimension
s of array

To print
the
diagonal
elements

To create
diagonal
matrix

Unit
Matrix

All
enteries
ones
All
enteries
zeros

Generate
random
no’s

Creating
Array with
random
no’s
Indexing

Slicing

A slicing operation creates a view on the original array, which is just a way of accessing array data. Thus the original array is not copied in memory.
To create a copy use copy() function

View

Copy
Scaler
operation

Operation
s b/w two
arrays

Relational

Logical
Operations

Statistical
Operation

2D

Sorting
axis=0 means column wise , similarly axis =1 means row wise
1D
Broadcasting

It’s also possible to do operations on arrays of different sizes. NumPy transform these arrays so that they all have the same size: this
conversion is called broadcasting.

You might also like