Mageia Bugzilla – Attachment 11347 Details for
Bug 24356
python-numpy new security issue CVE-2019-6446
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Introduction to matrix handling.
tutorial.py (text/plain), 636 bytes, created by
Len Lawrence
on 2019-11-09 16:39:22 CET
(
hide
)
Description:
Introduction to matrix handling.
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2019-11-09 16:39:22 CET
Size:
636 bytes
patch
obsolete
># A few matrix operations: >import numpy as np >a = np.arange( 15 ).reshape( 3, 5 ) >print( a ) >print( a.shape ) >print( a.ndim ) >print( a.dtype.name ) >print( a.itemsize ) >print( a.size ) >print( type( a ) ) >b = np.array( [6, 7, 8] ) >print( b ) >print( type( b ) ) > >c = np.array( [(1.5,2,3), (4,5,6)] ) >print( c ) > >d = np.array( [ [1,2], [3,4] ], dtype=complex ) >print( d ) ># show the result of subtracting one array from another >a = np.array( [20,30,40,50] ) >b = np.arange( 4 ) >print( b ) >c = a - b >print( c ) ># square all the values in an array >print( b**2 ) >sines = 10*np.sin( a ) >print( sines ) >print( a < 35 ) > ># And so on and so forth.
# A few matrix operations: import numpy as np a = np.arange( 15 ).reshape( 3, 5 ) print( a ) print( a.shape ) print( a.ndim ) print( a.dtype.name ) print( a.itemsize ) print( a.size ) print( type( a ) ) b = np.array( [6, 7, 8] ) print( b ) print( type( b ) ) c = np.array( [(1.5,2,3), (4,5,6)] ) print( c ) d = np.array( [ [1,2], [3,4] ], dtype=complex ) print( d ) # show the result of subtracting one array from another a = np.array( [20,30,40,50] ) b = np.arange( 4 ) print( b ) c = a - b print( c ) # square all the values in an array print( b**2 ) sines = 10*np.sin( a ) print( sines ) print( a < 35 ) # And so on and so forth.
View Attachment As Raw
Actions:
View
Attachments on
bug 24356
: 11347