Five NumPy Functions a beginner should know about๐๐
๐งต๐
1โฃ ๐ป๐ฝ.๐ฎ๐ฟ๐ฟ๐ฎ๐
In Numpy, we create arrays using the "array" function.
Numpy gives the power to create multi-dimensional arrays.
๐ Code
2โฃ ๐ป๐ฝ.๐๐ต๐ฎ๐ฝ๐ฒ
The shape of an array is the number of elements in each dimension.
NumPy arrays have an attribute called shape that returns a tuple with each index having the number of corresponding elements.
๐ Code
3โฃ ๐ป๐ฝ.๐ฟ๐ฒ๐๐ต๐ฎ๐ฝ๐ฒ
reshape is used to change the shape of the NumPy array without changing the elements of the array.
reshape is one the best function of NumPy, it helps a lot in calculations.
๐ Code
4โฃ ๐ป๐ฝ.๐ฎ๐ฟ๐ผ๐๐ป๐ฑ
This mathematical function helps the user to evenly round array elements to given number of decimals
numpy.around(arr, decimals = 0, out = None)
decimal : [int, optional] Decimal places we want to round off
out : [optional] Output resulted array
๐ Code
5โฃ ๐ป๐ฝ.๐๐ฟ๐ฎ๐ป๐๐ฝ๐ผ๐๐ฒ
Remember, in your maths class, to find the transpose of a matrix you have to solve long calculations.
In NumPy, it can be done only in a single line using transpose.
It has no effect on a 1-D array!
๐ Code
Hey,
Thanks for reading the thread โค๏ธ
I post content about Python and Machine learning!!
If you like this thread, give it a retweet :)
Thanks
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.