Libraries in Python
Libraries in Python

In this Python Article, we are going to discuss on Python standard libraries and libraries that are very useful libraries in python.

What are Python Library

Basically a Library is collection of different module, package and API that allow us to use it repeatedly in python programs. It Make programming development faste, simple and easy to learn and implement.

Top Python Libraries: –

  1. Pandas
  2. Numpy
  3. Scipy
  4. SciKit Learn
  5. Keras

1. python pandas

 Pandas is an open source Library used for data analysis in python that provide high performance data manipulation.

Used for Data analysis because during the analysis require lots of processing like construction, cleaning, Merging etc.

Features :-

  1. Pandas is fast and simple compare to other tool
  2. Pandas is built on top of the Numpy package, means Numpy is required for operating the Pandas.
  3. Used for handling missing data
  4. Provide functions to work with Time Series.
  5. Customized Indexing
  6. Easily reshape data
  7. Easily work with slicing, indexing, filtering, GroupBy

Data Structure of Pandas: –

  1. Series
  2. Dictionary

Series: –

Series is one Dimensional array of any Datatype Without duplicate values. Series Connected with the index.

We Can easily convert list, Tuple, Dictionary into Series Using the inbuilt method series ().

#creating a Series Using Array:-
Import numpy as np
Import pandas as pd
Data = np.array([‘one’, ‘three’, ‘five’, ‘eight’, ‘ten’])
s = pd.Series(Data)
Dictionary :-

Dictionary is a two dimensional array with indexes  i.e. column and row and axes. Dictionary can be created using {}.

# Creating a Dictionary: - 
Import pandas as pd
s = [‘one’, ‘two’,’three’,’four’]
df = Pd.DataFrame(s)

2. python numpy

“Numerical Python” is defined by the term “NumPy.” Numpy   is an open source Library used for mathematical purpose in python that provide high Number of method to work with data.

Numpy also use with packages like Scipy and Matplotlib

Attributes of Numpy is shape, ndim, flags.

python numpy logo

Features of numpy: –

  1. It is a user friendly library.
  2. Can understand coding easily.
  3. Useful for Machine Learning UseCases.

3. python scipy

Scipy is an open source scientific library used for solving mathematical, scientific and Technical Problems. Scipy built top on python Numpy Extension.

It contains different sub package that help to solve scientific problems.

It Operate on Numpy Library.

Some Sub Package has Shown Below:-

Sub packageDescription
scipy.ioused for data input and output.
scipy.optimizeUsed for optimization
scipy.statsUsed for Statistics
scipy.signalUsed in single analytics.
scipy.specialSpecial Functions

4. Python SciKit Learn (Sklearn)

Scikit-learn is the useful library for machine learning in Python. It provide tools for machine Learning and Statistics algorithm.

Scikit-learn built upon NumPy, SciPy and Matplotlib.

It Supports algorithm like KNN, random forest, Support Vector Machine (SVM).

python sklearn

Features of sklearn :-

  1. Machine Learning Algorithm:- Support almost all Supervised and unsupervised machine Learning algorithm
  2. Clustering:- Used for grouping unlabeled Data.
  3. Cross validation:- used to Check accuracy of Supervised Model.
  4. Feature Extraction:- Used to Extract  features from Row Data.
  5. Feature Selection:- Identify useful attributes to built machine Learning Model
#Examples :-
First need to Install Scikit Learn Library by following command:- 
pip install -U scikit-learn

Import scikit learn Using Following Line:- 
from sklearn import datasets

5. Python Keras

Keras is Open Source Python Library for developing deep learning models.

It use for Numerical Computation.

The Theano and TensarFlow libraries help to define and train neural Network models in few lines of code  

Keras runs on top of open of ML Library Like TensorFlow, Theano or Cognitive Toolkit (CNTK).

Features :-

  • Easy to Understand concepts.
  • It supports prototyping.
  • It runs on Both CPU as well as GPU.
  • It is really very simple to get started with.
  • Easy production of models actually makes Keras special.

Keras has three backend engines, which are as follows:

Tensor Flow:-

     Tensor Flow is an open source library used for machine learning and artificial intelligence. Also useful for developing deep learning applications

Theano is a Python library that help to Work with  mathematical expressions in Machine Learning, It can rival typical full C-implementations in most of the cases.

Microsoft Cognitive Toolkit

It is a open Source library use for to create machine learning prediction models. It contains basic building blocks, which are required to form a neural network. The models are trained using C++ or Python.