ARTICLE UPDATED MAY 2026
Python is a programming language that stands out for its versatility and the enormous ecosystem of libraries surrounding it. As well as being open-source, it is cross-platform, has a simple syntax and a very extensive standard library, to which thousands of third-party packages are added for almost any task we can imagine.
In this article, we will look at what a Python library is exactly, what types exist, and we will review some of the most widely used ones today in fields such as data analysis, machine learning, or visualisation.
What is a Python library?
In programming, a library is a set of reusable modules and functions that allow specific tasks to be performed without having to write all the code from scratch. In the case of Python, a library groups together implementations that solve common problems (working with dates, connecting to APIs, processing data, creating graphics, etc.) through a well-defined interface.
Each library can be made up of one or more modules and, in many cases, is organised around a main purpose: numerical calculation, visualisation, machine learning, web development, text processing, among others. Some are part of the standard Python library (they are installed along with the language itself) and others are distributed as external packages that are added to the project when needed.
The Python Standard Library
The basic Python libraries, also called the standard library, are those that are included by default when you install the language. Among them, we find modules for working with the file system (us, pathlib), dates (datetime), regular expressions (re), JSONJSON), attendance (threading, asyncio) and many other essential functions.
Although Matplotlib is well-known, it's not part of the standard library, but rather an external library focused on visualisation. The combination of the standard library with the ecosystem of external packages is what makes Python so flexible for all kinds of projects.
Types of Python libraries according to their purpose
We can group Python libraries according to the problems they help to solve. Some of the most common types are:
- Deep learning
Focused on building and training deep neural networks for tasks such as computer vision, natural language processing, or content generation. - Traditional machine learning
Libraries that facilitate the training of supervised and unsupervised models (classification, regression, clustering) and data pre-processing. - Numerical and scientific computation
Designed for working with multidimensional arrays, linear algebra, transforms and high-performance mathematical operations. - Data visualisation
Tools for creating static and interactive charts and dashboards that help to interpret and communicate information. - Natural Language Processing (NLP)
Libraries for tokenising text, calculating frequencies, working with embeddings, performing sentiment analysis, or building language models. - Explainable artificial intelligence
Packages that enable the analysis and explanation of the behaviour of AI models, interpreting the significance of their variables and decisions.
In addition to these categories, there are libraries for web development, automation, web scraping, testing, 3D visualisation, audio, video games and many other areas.
How to install a Python library?
The most common way to install external libraries in Python is by using pip, the official package manager for the ecosystem. Instead of manually downloading files, the command line is used to add dependencies to the working environment.
The typical process is as follows:
- Check that you have pip available
You can check this using a command such as python3 -m pip –version o py -m pip –version according to your operating system. - Install a specific library
From the terminal, you run a command like:
python3 -m pip install library_name
For example, python3 -m pip install numpy o python3 -m pip install pandas. - Version and environment management
It's good practice to use virtual environments (python3 -m venv) to isolate the dependencies of each project and avoid conflicts between library versions.
From there, you just need to import the library into your code with import library_name and start using its features.
9 Python libraries you need to know
There are thousands of packages, but a core set of libraries has become established as pillars in data science, analysis, and machine learning. These are nine of the most relevant:
- NumPy
NumPy is the foundation of numerical computing in Python. It provides efficient multidimensional arrays and vectorized operations, enabling high-speed mathematical and scientific calculations. Many other libraries (such as Pandas, SciPy, or Scikit-learn) rely on NumPy for their internal operation.
- Pandas
Pandas is the go-to library for manipulating and analysing structured data. It introduces structures such as Series y DataFrame, which facilitate the loading of data from files, as well as its cleaning, transformation, grouping and combination. It is essential in projects within data science, finance, economics, engineering and the social sciences.
- Matplotlib
Matplotlib is one of the oldest and best-known libraries for creating charts in Python. It allows for the generation of bar charts, histograms, line plots, heatmaps, and many other visualisations, which can be exported to different formats for reports or publications. Although its API can be detailed, it remains the foundation upon which other higher-level libraries are built.
- Seaborn
Seaborn is built on top of Matplotlib and offers a high-level interface for creating more elaborate statistical visualisations with less code. It makes it easy to create distribution plots, relationships between variables, heatmaps, and other highly useful representations for understanding complex datasets.
- Bokeh
Bokeh is designed for interactive visualisation, particularly in the browser. It allows you to create dynamic charts, dashboards and data applications that users can explore, filtering and zooming without reloading the page. It is a good choice when you want to combine Python with interactive web interfaces.
- Scikit-learn
Scikit-learn is one of the most widely used libraries for classic machine learning in Python. It includes a broad collection of algorithms for classification, regression, clustering, dimensionality reduction, and model evaluation, as well as data preprocessing tools. Its consistent API and documentation make it ideal for learning and prototyping models.
- TensorFlow
TensorFlow, originally developed by Google, is one of the key libraries for deep learning and large-scale numerical computation. It enables the definition and training of complex neural networks, utilising GPU and TPU acceleration. It is used in projects involving computer vision, speech recognition, NLP and many others.
- PyTorch
PyTorch, powered by Meta, is another go-to library for deep learning, very popular in research and production applications. It stands out for its dynamic approach (defining computation graphs at runtime) and for a syntax very close to standard Python, which facilitates experimentation.
- Keras
Keras provides a high-level interface that makes it easier to build deep learning models, abstracting away some of the complexity of libraries such as TensorFlow. It allows you to define neural networks declaratively and quickly, making it a good choice for prototyping ideas and educational projects.
Learn Python and data science
Python libraries are one of the main reasons why this language has become a de facto standard in data analysis, artificial intelligence and the development of technological solutions. Mastering tools such as NumPy, Pandas, Matplotlib and Scikit-learn allows you to go far beyond the basics of the language and solve real-world problems in professional settings.
If you want to delve deeper into Python, data science and machine learning, at IMMUNE you can explore our technological academic offerings and find the programme that best suits your profile and goals. In the section on programmes You will discover data-oriented itineraries, artificial intelligence and software development that will allow you to build a solid foundation and learn to use the main libraries of the Python ecosystem in real projects.

