






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This study document provides a comprehensive overview of NumPy, a powerful Python library for numerical computing. The document covers essential topics, including: 1. Detailed explanations of core concepts such as arrays, array creation, indexing, slicing. 2. key mathematical operations and functions supported by NumPy. Almost all the topics has ben discussed in this pdf. 3. Practical examples and code snippets for hands-on learning.
Typology: Exercises
1 / 11
This page cannot be seen from the preview
Don't miss anything!
2
3
2-D
as p.asanyP 2,3,4,31)
hp.aacyan (^) eC42)leen
Ly2,34, 5] <e lass 'humpry neaMRoy'
np.anayCe,^ 3)^ L45,6)
ndim t6 cbeck the no | dimensi'ons aa st (^) ndmin to (^) de<ine
Annay Inding
tophint
pant
43
3-D arYay
Nagalve
1be no
LC2[4, 5,3] 6)| o’’ dimesio
anA LO)
a dimensiohs (5an array
[1,s,4]
’ to^ access^ the
have
anACcIlastelement.
PRA
(2]
2
Houw may 2-D ous Lib ong
dim no. elegens
at 1be
4322
each
look no.o’ Os 2 dim’
Fut (4)ci>
3
shape >22,e
nlim’
L
C11,20)
L1S,16(i3,14]
C, 12]
(c 2), C?,4], (5,6)
C34] \u,
(ls,6],
t341]
Caeuith (^) ale valuescan (^) aray (^) using last value ol 1he
shape
|Alwagsbe
3-D
24,6,8, 1D
To the values
hdmn (^) sing, a and veyisg
P arayC^ C24E8,lo^ nclmin=^ e)
L3,4)
imens/'o
Reshape (^) fom bpto 2-D
hee
using a vecto
’eghape C4,2 22
tbe
the
d = 6
cçmension
qns
gnaally yeino ouag y acking along
X=
joins ansay^ along^ columns^ Csam^ as^ hs^ tacy
parayIC96L1,81J)
Ls,6),
hp aYray^ C^ Ci,2,33^ c4,5,^ J]) bp (^) concatenate CCat (^) ae), (^) axis=)
etackCCass (3,4]
preyCe23,C3,4) 2
sie ol^ all^ inpt^ arays^ should^ be shape np. slack’ uil increase The iensis
the unò ensionstack abog^ begbl nparrag Qc2, c aT2- np araydsackCoasl, C(C 5,63, CJ, aY a11) 22) pruot(np
same.
{latteos d bfane
Meun bp-muan
mean
phunlCap-meanCas)
|
np mean priolCnp:me an^ Cane,^ axy^ o)) t 23
2 mean & [in: |44 |7+12+23 t 44 13t6t 21t3+ 9 234 2t 54+ (t
12
(
axy o’column
54 moah
prinT Cnp^ mLan^ Cas,^ axU^ =1))
31- 8-
23
15-
24.0 D |5 00
\6.
1h2 lan
22- 22-
Man
a9M= np-a((5P5cuy^ CC5,^ 3,5)
pintCnp mazCa)
(Bame {or np meay
to
3 5]
4heue
Dp. obee
min mill
an it
wel]
the
NaN
flatten
ancl then od Vlue lo 1he arny, Dpnan mean, np hanmAr, hp:napmin