Sitemap

Essential Python Libraries 📚

3 min readJul 6, 2023

--

Press enter or click to view image in full size

Python, a widely-used programming language, has become immensely popular in the tech community. Its simplicity, readability, and vast collection of libraries have made it a preferred choice for developers. Libraries play a crucial role in Python by offering ready-made tools and functions that help developers solve complex problems more easily. In this blog, we will explore essential Python libraries for data science, discovering their power and potential in extracting valuable insights from data. Let’s embark on this exciting journey together and uncover the wonders of these libraries!

NumPy

NumPy (https://numpy.org/) short for Numerical Python, has long been a cornerstone of numerical computing in Python. It provides data structures, algorithms and library glue needed for most scientific application involving numerical data in Python. It also contains

  • A fast and efficient multi-dimensional array
  • Functions for performing element wise computation
  • Tools for reading and writing an array based datasets to disk
  • Linear algebra, Fourier transform, Random number generation
  • A mature C API to enable python extension
  • It acts as a container for data to be passed between algorithms and libraries

pandas

Pandas (https://pandas.pydata.org/) provides high level data structures and functions designed to make working with structured and tabular data intuitive and flexible.
Pandas blends the array-computing ideas of NumPy with the kinds of data manipulation capabilities found in spreadsheet or relational databases (such as sql). It provides indexing functionality to enable you to reshape, slice and dice, perform aggregation and select subset of data

Get Trinesh’s stories in your inbox

Join Medium for free to get updates from this writer.

Primary objects in pandas

  • DataFrame
  • Column oriented data structures with with both row and column labels
  • One dimensional array objects
  • Data structures with labelled axes supporting automatic or explicit data alignment
  • Integrated time series functionality
  • The same data structures handling both time series data and non-time series data
  • Arithmetic operations
  • Flexible handling of missing data
  • Merge and other relational operations found in popular databases (SQL based) etc..

matplotlib

Matplotlib (https://matplotlib.org/) is a popular python library for producing plots and other two-dimensional data visualizations. It is designed for creating plots suitable for publications. While others are visualization libraries available for python programmers.

IPython and Jupyter

IPython (https://ipython.org/) is a better interactive python interpreter. While it does not provide any computational or data analytical tools by itself, IPython is designed for both interactive computation and software development work.
Python is an interpreted language, it encourages execute-explore workflow rather than edit-compile-run workflow of many other programming languages

SciPy

SciPy (https://scipy.org/) is a collection of packages addressing a number of foundational problems in scientific computing. Here are some of the tools which contain various modules.

  • scipy.integrate: Numerical integration routines and differential equation solvers
  • scipy.linalg: Linear algebra rountines and matrix decimpositions
  • scipy.optimize: Funtion optimizers and root finding algorithms
  • scipy.signal: Signal processing tools
  • scipy.sparse: Sparse matrices and root finding algorithms
  • scipy.special: Wrapper around SPECFUN, a FORTRAN library implementing many common mathematical functions, such as gamma function
  • scipy.stats: Standard continuous and discrete probability distribution (density functions, samplers, continuous distribution functions), various statistical tests and more descriptive statistics

scikit-learn

Scikit-learn (https://scikit-learn.org/stable/) become a premier general purpose machine learning toolkit for python programmers.

  • Classification: SVM, nearest neighbours, random forest, etc.
  • Regression: Lasso, Ridge, Linear regression, ElasticNet, etc.
  • Clustering: k-means, spectral clustering
  • Dimensionality Reduction: PCA, feature selection, matrix factorization
  • Model Selection: Grid search, cross-validation, metrics
  • Preprocessing: Feature extraction and Normalization

statsmodels

Statsmodels (https://www.statsmodels.org/stable/index.html) is a statistical analysis package which contains algorithms for classical statistics and econometrics.
This includes submodules such as

  • Regression models: linear regression, generalized linear models, robust linear models, linear mixed effects models, etc
  • Analysis of Variance (ANOVA)
  • Time series analysis: AR, ARMA, ARIMA, VAR and other models
  • Nonparametric methods: Kernel density estimation, kernel regression
  • Visualization of statistical model results

statsmodels are more focused on statistical inference, providing uncertainty estimates and p-values for parameters. scikit-learn by contrast, is more prediction based.

In this blog, we’ve only scratched the surface of the essential Python libraries. There are numerous other libraries that are worth exploring, such as TensorFlow and PyTorch, which have gained popularity in the fields of machine learning and artificial intelligence. If you’re curious to learn more about Python libraries, you can refer to the official Python documentation at https://docs.python.org/3/library/. It provides a comprehensive resource to discover a wide range of libraries and their functionalities 🙏.

--

--