21 Jul, 7 tweets, 3 min read
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,

I post content about Python and Machine learning!!

If you like this thread, give it a retweet :)

Thanks

โข โข โข

Missing some Tweet in this thread? You can try to force a refresh
ใ

This Thread may be Removed Anytime!

Twitter may remove this content at anytime! Save it as PDF for later use!

# More from @Sauain

20 Jul
๐ฃ๐๐ฃ-๐ด

-Want to write an "Eye-pleasing" Python code ๐ ๐?

-PEP is a thing you MUST know about while learning or writing a python code

-Python Enhancement Proposal

-Basically a guide to "๐๐ผ๐ ๐๐ผ ๐๐ฟ๐ถ๐๐ฒ ๐ฎ ๐ฏ๐ฒ๐ฎ๐๐๐ถ๐ณ๐๐น ๐ฝ๐๐๐ต๐ผ๐ป ๐ฐ๐ผ๐ฑ๐ฒ?"

We all know that besides having logic and coding in any programming language, there is an important factor that is "coding style"

-How we are giving spaces?
-How to import libraries?
-etc

These things are very important to write a beautiful code!
For Python, PEP 8 has emerged as the style guide that most projects adhere to.

It promotes a very readable and "eye-pleasing" coding style. ๐

A code which anyone will love to read and is very easily understandable.
19 Jul
๐ฅ๐ฒ๐ถ๐ป๐ณ๐ผ๐ฟ๐ฐ๐ฒ๐บ๐ฒ๐ป๐ ๐น๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด ๐ค

-A type of Machine Learning (What is it?)
-It's working
-Real-life Applications
-A book for learning RL
-Limitations

๐งต๐
๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ฅ๐ฒ๐ถ๐ป๐ณ๐ผ๐ฟ๐ฐ๐ฒ๐บ๐ฒ๐ป๐ ๐น๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด?

- A machine learning area.

-In RL an ML model is trained to take a sequence of decisions.

-If the model takes a correct decision it will get awarded otherwise negative points will be given.

Perfect Explanation๐
๐ช๐ผ๐ฟ๐ธ๐ถ๐ป๐ด

Environment: Physical world in which the agent operates

State: Current situation of the agent

Reward: Feedback from the env.

Policy: Method to map agentโs state to actions

Value: Future reward that an agent would receive by taking an action in particular state
14 Jul
๐๐ฎ๐ฎ๐ฟ ๐๐ฎ๐๐ฐ๐ฎ๐ฑ๐ฒ๐๐จโ๐ป

- Arguably OpenCVโs ( Open source Computer Vision ) most popular object detection algorithm.

-What is it?
-Algorithm
-Limitation
-Applications

We are living in an era, where object detection is used everywhere.

From security cameras to our mobile phones, it is used everywhere.

Haar classifiers, classifiers were used in the ๐ณ๐ถ๐ฟ๐๐ ๐ฟ๐ฒ๐ฎ๐น-๐๐ถ๐บ๐ฒ ๐ณ๐ฎ๐ฐ๐ฒ ๐ฑ๐ฒ๐๐ฒ๐ฐ๐๐ผ๐ฟ.
๐ช๐ต๐ฎ๐ ๐ถ๐ ๐๐ฎ๐ฎ๐ฟ ๐๐ฎ๐๐ฐ๐ฎ๐ฑ๐ฒ โ

Haar Cascade classifiers are an effective way for object detection.

This method was proposed by Paul Viola and Michael Jones in their paper Rapid Object Detection using a Boosted Cascade of Simple Features.
13 Jul
Learn Python while playing games ๐ฏ

Five Ideas to make a game using Python๐

๐งต
1โฃ Dice Roller

Have no dice for your ludo game?

No worries you can create one using Python in just a few minutes.

Just use a random library and make one for yourself๐
2โฃ Hangman

You can make this game in Python too ;)

The word to guess is represented by a row of dashes.

If the player guesses a letter that exists in the word, the script writes it in all its correct positions. The player has 10 turns to guess the word.
12 Jul
Seven Python Math Library Functions ๐งฎ ๐

A beginner should know about these important functions, it will make your work easy!!

1โฃ ๐๐พ๐ฟ๐

In python, to find the square root of any number ( 3 is the square root of 9 ) you don't have to use power operator.

There is a special function " sqrt " which square roots the number given it as a parameter :)

๐ Code
2โฃ ๐ฝ๐ผ๐

In the above tweet, we have learned how to square root a given number.

A square root is actually a number raised to a power of 0.5

But what if we want 3 or something as power.

Here we use " pow(x,y) " it returns x raised to power y.

๐ Code
10 Jul
Five Python Libraries for Machine Learning ๐

1โฃ ๐ง๐ฒ๐ป๐๐ผ๐ฟ๐๐น๐ผ๐

It is an open-source library created by the Google Brain team.

It is very popular for high-performance numerical computation.

It has an ecosystem of tools, libraries, and community resources for building and deploying powerful ML applications.
2โฃ ๐๐ฒ๐ฟ๐ฎ๐

Keras is a deep learning API written in Python, running on top of the machine learning platform TensorFlow.

It is a high-level neural networks API capable of running on top of TensorFlow, CNTK, or Theano.

It can run seamlessly on both CPU and GPU.