Python NumPy »
|
My Coding >
Programming language >
Python >
Python libraries and packages >
Python NumPy
Python NumPy (Page: 2)Go to Page: NumPy shape and reshapingSometimes it is very easy to initialize one-dimensional array and then cut it into multi-dimensional array. This procedure called “reshaping” Identifying shape of existing NymPy arrayWe can check shape or dimension and size of any NumPy array with property ‘shape’
Simple reshapingIf we have linear (one dimensional) array, we can reshape it into array with any amount of dimensions, but it necessary to keep eye on proper size. If it will be mismatch in amount of data for reshaping, the error will be produces.
Creating similar arrayAnother opportunity is to create similar array, filled with some basic values. We have very similar functions:
All these functions are very similar in use:
Outputset_printoptions - can be used to change output of array with command print
|
Last 10 artitles
9 popular artitles
|
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |