{"id":7319,"date":"2022-03-17T07:59:23","date_gmt":"2022-03-17T06:59:23","guid":{"rendered":"https:\/\/immune.institute\/?p=7319"},"modified":"2026-05-21T13:05:13","modified_gmt":"2026-05-21T11:05:13","slug":"librerias-python-que-son","status":"publish","type":"post","link":"https:\/\/immune.institute\/en\/blog\/librerias-python-que-son\/","title":{"rendered":"Python libraries, what are they and which are the best?"},"content":{"rendered":"<p>ARTICLE UPDATED MAY 2026<\/p>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<h2><b>What is a Python library?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<h2><b>The Python Standard Library<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">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 (<\/span><span style=\"font-weight: 400;\">us<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">pathlib<\/span><span style=\"font-weight: 400;\">), dates (<\/span><span style=\"font-weight: 400;\">datetime<\/span><span style=\"font-weight: 400;\">), regular expressions (<\/span><span style=\"font-weight: 400;\">re<\/span><span style=\"font-weight: 400;\">), JSON<\/span><span style=\"font-weight: 400;\">JSON<\/span><span style=\"font-weight: 400;\">), attendance (<\/span><span style=\"font-weight: 400;\">threading<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">asyncio<\/span><span style=\"font-weight: 400;\">) and many other essential functions.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<h3><b>Types of Python libraries according to their purpose<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">We can group Python libraries according to the problems they help to solve. Some of the most common types are:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Deep learning<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Focused on building and training deep neural networks for tasks such as computer vision, natural language processing, or content generation.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Traditional machine learning<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Libraries that facilitate the training of supervised and unsupervised models (classification, regression, clustering) and data pre-processing.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Numerical and scientific computation<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Designed for working with multidimensional arrays, linear algebra, transforms and high-performance mathematical operations.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Data visualisation<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Tools for creating static and interactive charts and dashboards that help to interpret and communicate information.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Natural Language Processing (NLP)<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Libraries for tokenising text, calculating frequencies, working with embeddings, performing sentiment analysis, or building language models.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Explainable artificial intelligence<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Packages that enable the analysis and explanation of the behaviour of AI models, interpreting the significance of their variables and decisions.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">In addition to these categories, there are libraries for web development, automation, web scraping, testing, 3D visualisation, audio, video games and many other areas.\u00a0<\/span><\/p>\n<h2><b>How to install a Python library?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">The most common way to install external libraries in Python is by using <\/span><span style=\"font-weight: 400;\">pip<\/span><span style=\"font-weight: 400;\">, the official package manager for the ecosystem. Instead of manually downloading files, the command line is used to add dependencies to the working environment.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The typical process is as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Check that you have <\/b><b>pip available<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">You can check this using a command such as <\/span><span style=\"font-weight: 400;\">python3 -m pip \u2013version<\/span><span style=\"font-weight: 400;\"> o <\/span><span style=\"font-weight: 400;\">py -m pip \u2013version<\/span><span style=\"font-weight: 400;\"> according to your operating system.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Install a specific library<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">From the terminal, you run a command like:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">python3 -m pip install library_name<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">For example, <\/span><span style=\"font-weight: 400;\">python3 -m pip install numpy<\/span><span style=\"font-weight: 400;\"> o <\/span><span style=\"font-weight: 400;\">python3 -m pip install pandas<\/span><span style=\"font-weight: 400;\">.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Version and environment management<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">It's good practice to use virtual environments (<\/span><span style=\"font-weight: 400;\">python3 -m venv<\/span><span style=\"font-weight: 400;\">) to isolate the dependencies of each project and avoid conflicts between library versions.\u00a0<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">From there, you just need to import the library into your code with <\/span><span style=\"font-weight: 400;\">import library_name<\/span><span style=\"font-weight: 400;\"> and start using its features.\u00a0<\/span><\/p>\n<p><b>9 Python libraries you need to know<\/b><\/p>\n<p><span style=\"font-weight: 400;\">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:\u00a0<\/span><\/p>\n<ol>\n<li><b> NumPy<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"2\">\n<li><b> Pandas<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Pandas is the go-to library for manipulating and analysing structured data. It introduces structures such as <\/span><span style=\"font-weight: 400;\">Series<\/span><span style=\"font-weight: 400;\"> y <\/span><span style=\"font-weight: 400;\">DataFrame<\/span><span style=\"font-weight: 400;\">, 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.\u00a0<\/span><\/p>\n<ol start=\"3\">\n<li><b> Matplotlib<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"4\">\n<li><b> Seaborn<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"5\">\n<li><b> Bokeh<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"6\">\n<li><b> Scikit-learn<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"7\">\n<li><b> TensorFlow<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"8\">\n<li><b> PyTorch<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<ol start=\"9\">\n<li><b> Keras<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<h2><b>Learn Python and data science<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">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.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">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 <\/span><a href=\"https:\/\/immune.institute\/en\/programas\/\"><span style=\"font-weight: 400;\">programmes<\/span><\/a><span style=\"font-weight: 400;\"> 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. <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>ART\u00cdCULO ACTUALIZADO EN MAYO DE 2026 Python es un lenguaje de programaci\u00f3n que destaca por su versatilidad y por el enorme ecosistema de librer\u00edas que lo rodea. Adem\u00e1s de ser de c\u00f3digo abierto, es multiplataforma, cuenta con una sintaxis sencilla y dispone de una biblioteca est\u00e1ndar muy amplia, a la que se suman miles de [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":7877,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ai_generated_summary":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-7319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts\/7319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/comments?post=7319"}],"version-history":[{"count":0,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts\/7319\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/media\/7877"}],"wp:attachment":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/media?parent=7319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/categories?post=7319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/tags?post=7319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}