10 Important Python Libraries for ML

Whenever anyone talks about machine learning or data science, the one language which comes to mind is Python. However, it is not the only language used. We have other languages such as R. But of course, python is mostly preferred over any other language.
There are definitely a few reasons for it. First thing first, It’s easy to learn and write. If you know English, you can learn python. It’s that easy. Now, do you know what makes python the favorite of all? The availability of different libraries.
Libraries are collections of codes that we can use. So basically, someone else wrote the code and created a library out of it. Now if you want to execute some similar task, you can simply install the library, then import it and finally use it in your code.
Python has an enormous number of libraries. It has a library for almost everything. That is the reason it has such a huge fan base. May be bigger than BTS.
Here I am going to list down 10 such libraries which I use in my daily life of doing projects and practicing Machine Learning that too along with the steps they are used at.
This is the first library I learned in python. Pandas is a data manipulation library. It’s used for data analysis and data preprocessing. Pandas can handle 3 types of data structures. 1) Series (1D data structure)2) Dataframe(2D data structure)3) Panel Data (3D data structure)
BTW, by looking at the names of the 3 data structures, can you guess why Pandas is named ‘PANDAS’? Pandas is mostly used for the data cleaning part in traditional Machine learning because it can handle structured data very well. Pandas provide capabilities to read and write data from different sources like CSVs, Excel, SQL Databases, HDFS, and many more. It provides functionalities to add, delete update different feature columns. We can handle missing values, object data types, and outliers in feature columns.
To use pandas, you have to install pandas from its source using the following command in CMD: pip install pandas
And then import it into your code like this:
Numpy is a python library for linear algebra. It is the base library on which different libraries such as pandas or Keras etc are built. Using NumPy we can handle multi-dimensional arrays. In ML language they are called nd arrays. It can handle any kind of matrix manipulation operations such as reshaping, resizing, transposing, matrix manipulation, etc. Think of matrix in python, think of NumPy.
Learning NumPy had an indirect benefit on my learning journey. It made understanding computer vision related coding and functions very easy.
PS: Again try to think why it has this name.
BTW, to make use of NumPy, you first have to install it using the following command in CMD pip install numpy
Then you will have to import it into the notebook where you wish to use it. That can be done using the following code:
These two are python libraries for data visualization. When you are performing data analysis, you simply can not ignore data visualization. Data visualization is a process where you try to explore any feature and extract some pattern from the features using some plot. See, you can also do the same by printing a screenful of numbers, and strings and staring that for n number of hours or by simply making some meaningful plots out of the same data. If you want to go with the second one then these are the python libraries for you. Using Matplotlib or Seaborn you can make a different kinds of analyses such as 1) Univariate Analysis2) Bivariate Analysis3) Multivariate AnalysisThese analyses include many plots such as Line charts, Bar plots, Scatterplot, Countplot, Factorplot, Histograms, Distplot, Heatmap, Jointplot, and many more.
Seaborn is built upon matplotlib also the plot which will require 3–4 lines of code in matplotlib can be made using 1 line of code in seaborn. So you can go ahead with learning seaborn.


