DEV Community

Cover image for Python for everyone: Mastering python the right way.
viola kinya kithinji
viola kinya kithinji

Posted on


Python for everyone: Mastering python the right way.

python the right way
Huh the right way? Some might be wondering which is the right way. Truth be told I felt the same in the beginning and yes there is the right way. First a mindset how is your mindset like? It requires a positive mindset and a go getter. Secondly passion, are you passionate or you're doing it Because of you saw someone doing it?. Take for instance if you're not passionate and you face a challenge, wait yes there are challenges do you think you will maneuver?. And lastly the drive, what drives you to know more about python? .

What is python
Is an interpreted, interactive, object-oriented programming language. So what is python used for:

Data science: Analysis and Visualization
Image description
With a Python data visualization library, you can create a wide variety of plots and visual representations, such as:

-Lines, Bars, and Markers.
-Images, contours and fields.
-Subplots, axes and figures.
-Statistics (Box Plots, Bar Charts, and Histograms).
-Pie and polar charts.
-3D Plots.
and more!
You can add text, labels, annotations, color, shapes, collections, animations, and interactivity to your plots depending on the package or library that you choose to work with.

Libraries and Packages
Let's see some of the most popular packages and libraries to work with Python in data science:

Python for Data Analysis
-NumPy: this package is described as "the fundamental package for scientific computing with Python". According to the official website of this package, "nearly every scientist working in Python draws on the power of NumPy."
-Pandas: is "a fast, powerful, flexible source data analysis and manipulation tool."
Python for Data Visualization
-Matplotlib: is "a comprehensive library for creating static, animated, and interactive visualizations in Python."
Seaborn: is "a Python data visualization library based on matplotlib."
-ggplot2: is "a system for declaratively creating graphics, based on The Grammar of Graphics". According to its official website: "you provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details."
-Bokeh: is "an interactive visualization library for modern web browsers".
Pandas: this library has many tools for data visualization.

Machine learning

Python is an essential tool for every developer who wants to enter the fascinating area of Machine Learning. Let's see a brief introduction to Machine Learning.

What is Machine Learning?
Machine Learning is an area of Computer Science that creates systems that are able to learn on their own.

This type of system uses algorithms that are continuously improved based on input data that helps the system "learn". It learns how to respond autonomously to new scenarios by generating an appropriate output in new scenarios based on previous knowledge.

One of the most amazing things about these systems is that they are continually refined.

They are not like the programs that we typically write in a Python script where we specify every possible action that the program can take. In Machine Learning, the system is trained to "think" and make decisions based on previous knowledge.

This is why we say that machines "learn" from the data

-Neural Networks: The Building-Blocks of Machine Learning
-Neural networks are the processing units of the system. They try to simulate a real network of neurons of the brain. They virtual "neurons" receive input, learn how to process that input, and generate an output based on their previous knowledge.

This is very similar to what out brain does every single moment of every single day.

Thanks to neural networks, a Machine Learning algorithm can learn how to predict the expected output from a given input based on previous knowledge.

For example, when you see recommended videos on YouTube, those recommendations were generated by neural networks that predict what videos you might like to watch based on your previous patterns. Amazing, right?

Python and Machine Learning
you have this question in mind right?: what is the role of Python in this area? It is one of the most popular and powerful tools used to program this type of system.

One of the most popular libraries used by developers around the world to work with Python applied to Machine Learning is

-TensorFlow: It's a free open-source library developed by the Google Brain Team. This library is used for research and production at Google.
According to Jeff Dean, the lead of Google's Artificial Intelligence division:
Today it is used heavily in our speech recognition systems, in a new Google Photos product, Gmail, and Google Search. (source)
The best part is that developers all over the world can use this library to tackle real-world problems.

These are two other popular Python libraries used for Machine Learning:

-Keras – an open-source neural-network library written in Python.
-PyTorch – an open-source Machine Learning library used for developing and training neural networks.

Web development
Python is used widely by back-end developers to run servers for web applications and interacts with databases and APIs after after a client requests data from the app's front-end in the browser. It uses frameworks and libraries like Django, pyramid and flask that extends the language utility. The frameworks are use for security, scalabilty and convenience.

Computer science education
Python currently plays a key role in computer science education around the world. Let's see why.

Why Python?

Python is so widely used as a teaching tool because:

-It is easy to learn: its syntax is simple and it can be learned quickly. Students start diving into more advanced aspects of computer science much more quickly than with other programming languages.
-It is powerful: it is used in real-world applications, so students immediately start acquiring valuable skills for their careers.
-It is versatile: it supports various programming paradigms including imperative programming, functional programming, procedural programming, and object-oriented programming.

Desktop Applications

Python is use to build desktop applications. Example some Linux and open source applications used python. In addition cross platform applications are built with GUI libraries using python.

Business Applications
Tryton and Odoo are tools used for enterprise development they also perform accounting, inventory, customer relationship management and other tasks. Many businesses rely on python for heavy lifting.
Game development

python is also used in developing interactive games. We have libraries that provides functionality and a room for game development. Examples are Pysoy and Pygame.

Web scrapping
Python is used to pull large data from websites which is useful in real world activities. Python uses BeautifulSoup which pulls such data.

Computer Vision and Image Processing
Python is used for computer vision and image processing, fields that are expanding rapidly.

The goal of image processing is to process an image, apply transformations to it, and return a new version of the original image.

In contrast, the goal of computer vision is more complex because it tries to make the computer understand and interpret an image and its content.

Image Processing
Let's start with image processing. With a Python library, you can perform operations such as:

-Cropping, flipping, and rotating.
-Manipulating exposure and color channels.
-Detecting edges and lines.
-Adding filters and restoring images.
-Computer Vision

Now let's dive into computer vision. If you start researching this topic, you might be surprised by its current applications. Some of them are:

-Object and Event Detection.
-Facial recognition.
-Image classification.

This scientific field is so important that Google developed a tool called Cloud Vision, which has a Python version for developers to incorporate this functionality into their programs.

According to the "Using the Vision API with Python" tutorial in Google Codelabs, the Google Cloud Vision API:

Allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
This set of tools provides functionality for face detection, landmark detection, logo detection, label detection, text detection, and more.

Python Libraries
These are some awesome libraries for computer vision and image processing:

-OpenCV: an "open source computer vision and machine learning software library". Its Python version is called OpenCV-Python.
-scikit-image: a "collection of algorithms used for image processing".
-NumPy: it can be used to process the pixels of an image as a 2D array.
-SciPy: the scipy.ndimage package "contains various functions for multidimensional image processing."

We have a wide variety of python application kindly try to go through the rest and get insights and drive to be a python guru.

Important note
As a beginner you come across practice exercises, please do not copy paste them try do them manually. The point of these exercises is to train your hands, your brains and your mind in how to read, write and see code. If you're copypasting you are cheating yourself out of the effectiveness of the lessons.
we also have websites such as Hacker rank you can use it to assess yourself after covering a certain topic by trying the challenges offered there to see if you're understanding and if YOU can solve problems.

learning websites

*Conculsion *
As a beginner we have the fear of unknown and also some tend to suffer from the imposter syndrome please don't allow these monsters stop you, face them. Success is not final, failure is not fatal: it is the courage to continue that counts. Python is fun to work with if your motivated, driven and passionate to know what it entails and its applications and advantages. I have written two articles on introduction to data structure and algorithms the second one is introduction to modern python kindly take a look.

Top comments (0)

An Animated Guide to Node.js Event Loop

>> Check out this classic DEV post <<