Skip to main content

Top 33 Python Libraries for Data Science in 2026

The 33 Python libraries data scientists use in 2026, grouped by job, with the license and maintenance status of each.
Moez Ali
Moez Ali

Create Your Free Account

Practice and track your progress.

Continue with GoogleBy continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Add DataCamp as preferred source on Google

Python's data science stack is a set of libraries that each own one job: NumPy holds the arrays, pandas cleans the tables, Matplotlib draws the charts, scikit-learn fits the models, and PyTorch trains the neural networks. Pick the right one for the job and a week of work becomes an afternoon.

If you only learn 4, make them NumPy, pandas, Matplotlib, and scikit-learn. Add PyTorch for deep learning, Polars or DuckDB when your data outgrows pandas, and LangChain or LlamaIndex when you build on large language models (LLMs). If you are new to the language itself, start with our guide to learning Python.

Top 33 Python Libraries for Data Science at a Glance

The table lists all 33 libraries by group, with each one's license and maintenance status.

Licenses and maintenance status from GitHub and PyPI, as of November 26, 2026.
LibraryBest forLicenseMaintenanceKey differentiator
Staple Python Libraries
NumPyFast numerical arraysBSD-3-ClauseActiveThe array type every other library builds on
pandasCleaning and analyzing tabular dataBSD-3-ClauseActiveThe default DataFrame API for tabular work
MatplotlibFull control over static chartsMatplotlib License (Python Software Foundation-based)ActiveThe plotting layer most other chart libraries build on
scikit-learnClassical machine learningBSD-3-ClauseActiveOne consistent API for most classical ML algorithms
PolarsFast DataFrames on large datasetsMITActiveMulti-threaded, lazy query engine written in Rust
SciPyScientific computing and statisticsBSD-3-ClauseActiveOptimization, statistics and signal processing on NumPy arrays
SeabornStatistical charts with little codeBSD-3-ClauseMaintenance modeStatistical plots from DataFrames in one call
PlotlyInteractive chartsMITActiveInteractive, web-ready charts with hover and zoom
DuckDBSQL analytics on local filesMITActiveIn-process SQL engine that queries Parquet, CSV and DataFrames
PySparkData processing across a clusterApache-2.0ActiveThe Python API for Apache Spark
StreamlitTurning analyses into web appsApache-2.0ActiveData apps from a plain Python script
PydanticValidating data with type hintsMITActiveSchema validation from Python type hints
Machine Learning
XGBoostGradient boosting on tabular dataApache-2.0ActiveRegularized gradient boosting, CPU and GPU
LightGBMFast boosting on large tablesMITActiveHistogram-based, leaf-wise boosting built for speed
CatBoostBoosting with categorical featuresApache-2.0MaintainedHandles categorical columns without manual encoding
StatsmodelsStatistical models and inferenceBSD-3-ClauseActiveRegression and time-series models with full statistical output
SHAPExplaining model predictionsMITActiveShapley-value explanations for any model
OptunaHyperparameter tuningMITActiveDefine-by-run search spaces with pruning
RAPIDS cuDF and cuMLGPU-accelerated pandas and scikit-learnApache-2.0Activepandas and scikit-learn APIs on NVIDIA GPUs
Automated Machine Learning (AutoML)
AutoGluonHigh-accuracy AutoML in three linesApache-2.0ActiveStacked ensembles for tabular, text and image data
H2ODistributed AutoMLApache-2.0ActiveAutoML on a Java cluster with a Python client
FLAMLLow-cost AutoMLMITActiveCost-aware search that finds good models quickly
Deep Learning
PyTorchDeep learning research and productionBSD-3-ClauseActivePythonic, eager deep learning with the largest model ecosystem
TensorFlowDeploying models to mobile and webApache-2.0MaintainedProduction tooling from TensorFlow Serving to LiteRT
KerasHigh-level deep learning on any backendApache-2.0ActiveOne API over JAX, TensorFlow and PyTorch
JAXHigh-performance numerical researchApache-2.0ActiveNumPy-style code compiled with XLA and auto-differentiated
PyTorch LightningOrganizing PyTorch training codeApache-2.0ActiveRemoves training-loop boilerplate from PyTorch
fastaiLearning deep learning fastApache-2.0ActiveHigh-level PyTorch layer with strong defaults
Natural Language Processing
Hugging Face TransformersPretrained language and vision modelsApache-2.0ActiveOne API for thousands of pretrained models
spaCyProduction NLP pipelinesMITActiveFast, production-ready NLP pipelines
LangChainBuilding LLM applications and agentsMITActiveComposable building blocks for LLM apps and agents
LlamaIndexConnecting LLMs to your dataMITActiveIngestion, indexing and retrieval for RAG
ChromaDBEmbedding storage for RAG prototypesApache-2.0MaintainedEmbedded vector database with a small API

Staple Python Libraries for Data Science

The staples load, clean, plot, and model data, and almost every project uses several of them.

1. NumPy: Best for fast numerical arrays

NumPy is the array library the rest of the stack is built on: pandas columns, scikit-learn inputs, and Matplotlib data are NumPy arrays underneath. Vectorized operations run in compiled code instead of Python loops, which makes them orders of magnitude faster. Our Introduction to NumPy course covers the basics.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Active
  • Python: >=3.12
  • GitHub stars: 33K (November 2026)
  • Downloads: 1.2B a month (PyPI)
  • Install: pip install numpy

Key features:

  • Broadcasting: combine arrays of different shapes without loops.
  • Universal functions: fast element-wise math, reductions, and linear algebra.
  • Random generators: seedable Generator objects for reproducible simulations.

Pros:

  • Every other library on this list accepts NumPy arrays.
  • Stable, fast, and thoroughly documented.

Cons:

  • An array holds one data type, so mixed tables need pandas.
  • NumPy 2 removed aliases such as np.float_, which breaks older tutorials (see our NumPy 2.0 guide).

2. pandas: Best for cleaning and analyzing tabular data

pandas is the standard library for tabular data: its DataFrame reads CSV, Excel, Parquet, and SQL, and handles the filtering, joins, group-bys, and time series that fill most of a data scientist's week. pandas 3.0, released in January 2026, made Copy-on-Write the default and added a dedicated string type. Our Data Manipulation with pandas course is the place to start.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 51K (November 2026)
  • Downloads: 722M a month (PyPI)
  • Install: pip install pandas

Key features:

  • DataFrame and Series: labeled, mixed-type tables with alignment.
  • I/O: readers and writers for CSV, Excel, JSON, Parquet, and SQL.
  • Group-by and time series: aggregation, resampling, and rolling windows.

Pros:

  • The most tutorials and integrations of any Python data tool.
  • Almost every library on this list accepts a DataFrame.

Cons:

  • Runs in memory on one core, so datasets near your RAM size get slow.
  • pandas 3.0 removed applymap() and changed chained assignment, so older code needs updates.

3. Matplotlib: Best for full control over static charts

Matplotlib is Python's foundational plotting library: every element of a figure, from tick labels to annotations, is an object you can change. Seaborn and the pandas .plot() method draw with it underneath. Our Matplotlib tutorial and cheat sheet cover the essentials.

At a glance:

  • License: Matplotlib License (Python Software Foundation-based)
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 24K (November 2026)
  • Downloads: 206M a month (PyPI)
  • Install: pip install matplotlib

Key features:

  • Object-oriented API: fig, ax = plt.subplots() gives you a handle on every part of the chart.
  • Every chart type: line, bar, scatter, histogram, heatmap, 3D, and animations.
  • Publication output: PNG, SVG, and PDF at any resolution.

Pros:

  • Anything you can picture, you can draw.
  • The default chart library of scientific Python.

Cons:

  • Polished charts take many lines of code.
  • Static by default.

The object-oriented API in practice, a labeled line chart saved as a PNG:

import matplotlib.pyplot as plt
import numpy as np

months = np.arange(1, 13)
revenue = [42, 45, 51, 49, 58, 63, 61, 67, 72, 70, 78, 85]

fig, ax = plt.subplots(figsize=(7, 4))
ax.plot(months, revenue, marker="o")
ax.set(title="Monthly revenue", xlabel="Month", ylabel="Revenue ($K)", xticks=months)
ax.grid(alpha=0.3)
fig.savefig("revenue.png", dpi=150, bbox_inches="tight")

The code produces this chart:

Matplotlib line chart of monthly revenue rising from 42 to 85 thousand dollars over 12 months

4. scikit-learn: Best for classical machine learning

scikit-learn is the standard library for classical machine learning: regression, classification, clustering, preprocessing, and model selection, all behind the same fit() and predict() interface. Learn that interface once and you can swap a logistic regression for a random forest by changing one line. Our Supervised Learning with scikit-learn course is a good starting point.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 68K (November 2026)
  • Downloads: 223M a month (PyPI)
  • Install: pip install scikit-learn

Key features:

  • Consistent estimator API across every model, transformer, and metric.
  • Pipelines: Pipeline and ColumnTransformer chain preprocessing and modeling.
  • Model selection: cross-validation, grid search, and dozens of metrics.

Pros:

  • Excellent documentation with an example for nearly every class.
  • Pipelines make leakage-free evaluation the easy path.

Cons:

  • No deep learning, and limited GPU support.
  • Its gradient boosting is slower than XGBoost or LightGBM on large tables.

If you are unsure which estimator fits your problem, scikit-learn's own flowchart is still a good map:

Scikit-learn cheat sheet flowchart for choosing classification, regression, clustering, or dimensionality reduction methods

5. Polars: Best for fast DataFrames on large datasets

Polars is a DataFrame library written in Rust that runs queries on every CPU core and, in lazy mode, optimizes the whole query before running it. On multi-gigabyte files it is often many times faster than pandas, and version 2.0 (October 2026) tightened its type and null rules. Our Polars track, built with the Polars team, is free: 3 courses and about 11 hours, from Introduction to Polars to production pipelines.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 41K (November 2026)
  • Downloads: 72M a month (PyPI)
  • Install: pip install polars

Key features:

  • Lazy API: scan_csv() and scan_parquet() build an optimized query plan.
  • Streaming engine for data larger than memory.

Pros:

  • Multi-threaded by default.
  • A consistent API with no index to manage.

Cons:

  • Not a drop-in replacement for pandas.
  • Frequent breaking changes between major versions.

6. SciPy: Best for scientific computing and statistics

SciPy is the scientific computing layer on top of NumPy: optimization, integration, signal processing, sparse matrices, and the statistical tests in scipy.stats. When you need a t-test, a curve fit, or a distance matrix, this is where it lives. See our SciPy tutorial.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Active
  • Python: >=3.12
  • GitHub stars: 15K (November 2026)
  • Downloads: 413M a month (PyPI)
  • Install: pip install scipy

7. Seaborn: Best for statistical charts with little code

Seaborn builds statistical charts from a DataFrame in one call: pass column names, and it handles grouping, color, confidence intervals, and regression lines. Its last release came out in January 2024, but the code is still updated, so it is in maintenance mode rather than abandoned. Our Seaborn course teaches it.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Maintenance mode
  • Python: >=3.8
  • GitHub stars: 14K (November 2026)
  • Downloads: 32M a month (PyPI)
  • Install: pip install seaborn

Key features:

  • Dataset-oriented functions: scatterplot(), histplot(), and heatmap() take column names.
  • Readable themes and palettes without styling code.

Pros:

  • Exploratory charts in a fraction of Matplotlib's code.
  • Returns Matplotlib objects you can fine-tune.

Cons:

  • No release since January 2024.
  • distplot() is deprecated; use histplot().

8. Plotly: Best for interactive charts

Plotly makes interactive charts with hover, zoom, and pan, saved as standalone HTML or embedded in notebooks and Dash apps. Plotly Express builds most charts in one line from a DataFrame. Our Plotly Express tutorial covers it.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 19K (November 2026)
  • Downloads: 62M a month (PyPI)
  • Install: pip install plotly

9. DuckDB: Best for SQL analytics on local files

DuckDB is an analytical SQL database that runs inside your Python process and queries Parquet files, CSV files, and DataFrames directly, with no server. For analysts who think in SQL, it is the fastest way to aggregate files too big for pandas. Our introduction to DuckDB explains when to use it.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.11.0
  • GitHub stars: 43K (November 2026)
  • Downloads: 87M a month (PyPI)
  • Install: pip install duckdb

10. PySpark: Best for data processing across a cluster

PySpark is the Python API for Apache Spark: the same DataFrame and SQL code runs on a laptop or across a cluster, which makes it the standard for data too big for one machine, including on Databricks. Our PySpark tutorial gets you started.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 45K (November 2026)
  • Downloads: 48M a month (PyPI)
  • Install: pip install pyspark

11. Streamlit: Best for turning analyses into web apps

Streamlit turns a Python script into a web app, with widgets, charts, and layout from function calls and no front-end code. Data scientists use it for internal tools, model demos, and dashboard prototypes. Our Streamlit tutorial builds an app from scratch.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 47K (November 2026)
  • Downloads: 23M a month (PyPI)
  • Install: pip install streamlit

12. Pydantic: Best for validating data with type hints

Pydantic validates data against Python type hints, so configuration files, API responses, and LLM outputs match a schema before downstream code runs. LangChain and many LLM SDKs use it under the hood. Our Pydantic guide has examples.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 30K (November 2026)
  • Downloads: 1.2B a month (PyPI)
  • Install: pip install pydantic

Machine Learning Python Libraries

These libraries go beyond scikit-learn: gradient boosting for the most accurate tabular models, plus statistics, explanations, tuning, and GPU acceleration.

1. XGBoost: Best for gradient boosting on tabular data

XGBoost builds hundreds of small decision trees, each correcting the errors of the last, with regularization that keeps them from overfitting. It made its name winning Kaggle competitions and is still a default for churn, fraud, and pricing models. Our XGBoost tutorial covers it in depth.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.12
  • GitHub stars: 29K (November 2026)
  • Downloads: 33M a month (PyPI)
  • Install: pip install xgboost

Key features:

  • scikit-learn wrapper: XGBClassifier plugs into pipelines and grid search.
  • GPU training with device="cuda", which replaces the old tree_method="gpu_hist".

Pros:

  • Strong accuracy with little feature engineering.
  • Mature and supported everywhere.

Cons:

  • Many hyperparameters to tune.
  • Not suited to images, audio, or raw text.

2. LightGBM: Best for fast boosting on large tables

LightGBM bins feature values into histograms and grows trees leaf by leaf, which makes it faster and lighter on memory than XGBoost on large tables. The project moved from Microsoft's GitHub organization to its own in March 2026, with the same maintainers.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 19K (November 2026)
  • Downloads: 24M a month (PyPI)
  • Install: pip install lightgbm

Key features:

  • Histogram-based, leaf-wise trees for fast training on millions of rows.
  • Native categorical splits with no one-hot encoding.

Pros:

  • Fast training on large datasets.
  • Low memory use.

Cons:

  • Overfits small datasets unless you limit num_leaves.
  • Older tutorials pass early_stopping_rounds to fit(); current releases use callbacks.

3. CatBoost: Best for boosting with categorical features

CatBoost is the boosting library for data full of categorical columns: it encodes them internally, so you pass strings and skip the encoding step. Its defaults give competitive results with little tuning. See our CatBoost guide.

At a glance:

  • License: Apache-2.0
  • Maintenance: Maintained
  • GitHub stars: 9.2K (November 2026)
  • Downloads: 7.1M a month (PyPI)
  • Install: pip install catboost

4. Statsmodels: Best for statistical models and inference

Statsmodels is for statistical inference rather than prediction: regression and time series models that report coefficients, p-values, and diagnostics in the style of R. Use it when the question is which factors matter, and how sure you are. Our statsmodels regression course teaches it.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 12K (November 2026)
  • Downloads: 43M a month (PyPI)
  • Install: pip install statsmodels

5. SHAP: Best for explaining model predictions

SHAP explains predictions with Shapley values, showing how much each feature pushed a result up or down. It is the standard way to show stakeholders why a model decided what it did. Our introduction to SHAP values explains the method.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.12
  • GitHub stars: 26K (November 2026)
  • Downloads: 9.9M a month (PyPI)
  • Install: pip install shap

6. Optuna: Best for hyperparameter tuning

Optuna tunes hyperparameters by learning which settings work and stopping unpromising trials early. You define the search space in plain Python, and it works with any model library on this list.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 15K (November 2026)
  • Downloads: 15M a month (PyPI)
  • Install: pip install optuna

7. RAPIDS cuDF and cuML: Best for GPU-accelerated pandas and scikit-learn

RAPIDS is NVIDIA's suite of GPU libraries: cuDF runs pandas-style operations on the GPU, and cuML does the same for scikit-learn-style models. It needs an NVIDIA GPU; see our cuDF pandas accelerator overview.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 9.8K (November 2026)
  • Downloads: 266K a month (PyPI)
  • Install: pip install cudf-cu12

Automated Machine Learning (AutoML) Python Libraries

AutoML libraries try many models and settings for you and return the best one or an ensemble. They make strong baselines quickly.

1. AutoGluon: Best for high-accuracy AutoML in three lines

AutoGluon, from AWS, goes for accuracy over speed: it trains many model types and stacks them, which often beats hand-tuned models on tabular benchmarks. It also handles time series and multimodal data.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: <3.14,>=3.10
  • GitHub stars: 11K (November 2026)
  • Downloads: 52K a month (PyPI)
  • Install: pip install autogluon

2. H2O: Best for distributed AutoML

H2O's AutoML trains boosting, random forests, linear models, and stacked ensembles, then ranks them on a leaderboard. The computation runs in a Java process, which suits large datasets on a cluster. Our H2O AutoML tutorial shows the workflow.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.7
  • GitHub stars: 7.5K (November 2026)
  • Downloads: 159K a month (PyPI)
  • Install: pip install h2o

3. FLAML: Best for low-cost AutoML

FLAML is Microsoft's lightweight AutoML library: its cost-aware search finds a good model within a fixed time budget on a laptop and returns a scikit-learn-style estimator.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 4.4K (November 2026)
  • Downloads: 366K a month (PyPI)
  • Install: pip install flaml

Deep Learning Python Libraries

Deep learning libraries define and train neural networks on GPUs, with PyTorch and TensorFlow as the 2 main frameworks.

1. PyTorch: Best for deep learning research and production

PyTorch is the most widely used deep learning framework: models are Python classes, training is a loop you can step through in a debugger, and most new models on Hugging Face ship PyTorch weights first. Our Introduction to Deep Learning with PyTorch course is the place to start.

At a glance:

  • License: BSD-3-Clause
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 106K (November 2026)
  • Downloads: 57M a month (PyPI)
  • Install: pip install torch

Key features:

  • Eager execution: tensors and gradients you can inspect line by line.
  • torch.compile: faster training without changing how you write models.
  • Distributed training: data, tensor, and fully sharded parallelism.

Pros:

  • Pythonic and easy to debug.
  • The default for research code and pretrained models.

Cons:

  • You write the training loop yourself unless you add PyTorch Lightning.
  • TorchScript is deprecated, so older deployment tutorials need updating.

The explicit training loop is what sets PyTorch apart. Here it fits a linear model in 100 steps:

import torch
from torch import nn

X = torch.randn(256, 3)
y = X @ torch.tensor([2.0, -1.0, 0.5]) + 0.1 * torch.randn(256)

model = nn.Linear(3, 1)
optimizer = torch.optim.SGD(model.parameters(), lr=0.1)

for _ in range(100):                     # an explicit training loop you can step through
    loss = nn.functional.mse_loss(model(X).squeeze(), y)
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

print(model.weight.data.round(decimals=2), round(loss.item(), 4))

2. TensorFlow: Best for deploying models to mobile and web

TensorFlow is Google's end-to-end machine learning platform, and its strength today is deployment: TensorFlow Serving for servers, LiteRT for mobile and edge devices, and TensorFlow.js for browsers. Our PyTorch vs TensorFlow vs Keras comparison explains how the 3 differ.

At a glance:

  • License: Apache-2.0
  • Maintenance: Maintained
  • Python: >=3.10
  • GitHub stars: 202K (November 2026)
  • Downloads: 11M a month (PyPI)
  • Install: pip install tensorflow

Key features:

  • tf.data: fast, parallel input pipelines.
  • Deployment targets: SavedModel, Serving, LiteRT, and TensorFlow.js.

Pros:

  • The widest set of deployment targets here.
  • The most GitHub stars of any library on this list.

Cons:

  • Fewer new research models ship TensorFlow weights.
  • Many tutorials still use TensorFlow 1.x code.

3. Keras: Best for high-level deep learning on any backend

Keras is a high-level deep learning API that, since Keras 3, runs on JAX, PyTorch, or TensorFlow, so you write a model once and pick the backend later. Its fit() method makes it the gentlest way into neural networks. See our Keras course.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.11
  • GitHub stars: 64K (November 2026)
  • Downloads: 12M a month (PyPI)
  • Install: pip install keras

4. JAX: Best for high-performance numerical research

JAX is Google's library for high-performance numerical computing: NumPy-style code you can differentiate with grad, vectorize with vmap, and compile for GPUs and TPUs with jit. Neural network code usually adds a library such as Flax on top.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.12
  • GitHub stars: 37K (November 2026)
  • Downloads: 14M a month (PyPI)
  • Install: pip install jax

5. PyTorch Lightning: Best for organizing PyTorch training code

PyTorch Lightning moves training boilerplate into a Trainer: devices, mixed precision, multi-GPU training, logging, and checkpoints. Your model stays plain PyTorch. Our PyTorch Lightning tutorial goes through a full project.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 31K (November 2026)
  • Downloads: 4.9M a month (PyPI)
  • Install: pip install lightning

6. fastai: Best for learning deep learning fast

fastai is a high-level layer on PyTorch with strong defaults for vision, text, and tabular models, built alongside the free Practical Deep Learning for Coders course. It gets good results with very little code.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.10
  • GitHub stars: 28K (November 2026)
  • Downloads: 221K a month (PyPI)
  • Install: pip install fastai

Python Libraries for Natural Language Processing

These libraries process text and build applications on language models: Transformers provides the models, spaCy the fast linguistic pipelines, and the rest the building blocks of LLM apps.

1. Hugging Face Transformers: Best for pretrained language and vision models

Hugging Face Transformers is the standard library for pretrained models: one API downloads and runs thousands of text, vision, audio, and multimodal models from the Hugging Face Hub, for inference or fine-tuning. Transformers 5.0 shipped in January 2026. Our introduction to Transformers and Hugging Face walks through it.

At a glance:

  • License: Apache-2.0
  • Maintenance: Active
  • Python: >=3.11.0
  • GitHub stars: 169K (November 2026)
  • Downloads: 123M a month (PyPI)
  • Install: pip install transformers

Key features:

  • pipeline(): inference for a task in 2 lines.
  • Trainer: fine-tuning with mixed precision and distributed training.
  • generate(): text generation with streaming.

Pros:

  • Nearly every open model through one interface.
  • Pretrained models save you from training from scratch.

Cons:

  • Large models need a lot of GPU memory and disk space.
  • Model classes and arguments change between versions.

The pipeline() function is why most people start here: a pretrained sentiment model in 3 lines, with no API key:

from transformers import pipeline

classifier = pipeline("sentiment-analysis", model="distilbert/distilbert-base-uncased-finetuned-sst-2-english")
print(classifier([
    "The new dashboard saves me an hour every week.",
    "Support never answered my ticket.",
]))

2. spaCy: Best for production NLP pipelines

spaCy is a production NLP library for tokenization, tagging, parsing, and named entity recognition in fast pipelines. Use it when you need structured information from large volumes of text without calling an LLM. Our spaCy course covers it.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: <3.16,>=3.10
  • GitHub stars: 34K (November 2026)
  • Downloads: 26M a month (PyPI)
  • Install: pip install spacy

3. LangChain: Best for building LLM applications and agents

LangChain connects models, prompts, tools, and retrievers through one interface, so you can switch model providers and compose steps with the | operator. LangChain 1.0 (October 2025) moved older APIs such as LLMChain into a separate package. Our LangChain v1 tutorial covers the current API.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: <4.0.0,>=3.11.0
  • GitHub stars: 150K (November 2026)
  • Downloads: 157M a month (PyPI)
  • Install: pip install langchain

Key features:

  • Provider packages: the same code for Anthropic, OpenAI, Google, and open models.
  • Agents and structured output with tool calling and Pydantic validation.

Pros:

  • The largest set of integrations for LLM apps.
  • Swap model providers by changing one string.

Cons:

  • Abstraction layers can hide what is sent to the model.
  • Many tutorials still use the removed LLMChain.

4. LlamaIndex: Best for connecting LLMs to your data

LlamaIndex is built for retrieval-augmented generation (RAG): it loads, indexes, and retrieves the passages of your documents an LLM needs to answer questions about them. Our LangChain vs LlamaIndex comparison explains when to use which.

At a glance:

  • License: MIT
  • Maintenance: Active
  • Python: <4.0,>=3.11
  • GitHub stars: 53K (November 2026)
  • Downloads: 1.8M a month (PyPI)
  • Install: pip install llama-index

5. ChromaDB: Best for embedding storage for RAG prototypes

ChromaDB is an open-source vector database that runs inside your Python process and finds documents by meaning rather than keywords. It is the quickest vector store to prototype with. Our ChromaDB tutorial covers the API.

At a glance:

  • License: Apache-2.0
  • Maintenance: Maintained
  • Python: >=3.9
  • GitHub stars: 30K (November 2026)
  • Downloads: 8.3M a month (PyPI)
  • Install: pip install chromadb

Also Considered

Close calls that did not make the 33:

  • PyCaret: a low-code wrapper for scikit-learn workflows, left out because its last release was in April 2024.
  • Auto-sklearn: AutoML on top of scikit-learn, left out because its last release was in September 2022.
  • Dask: parallel pandas and NumPy across cores and clusters, where PySpark is the more common choice.
  • NLTK: the classic teaching library for NLP, mostly replaced by spaCy and Transformers in practice.
  • Bokeh: interactive browser charts, close to Plotly with a smaller user base.

How We Evaluated These Python Libraries

We read each library's PyPI page, GitHub repository, and download statistics on November 26, 2026, and its changelog for the last 12 months. The 3 code examples were run on Python 3.12 against the releases shown. The criteria, in weight order:

  1. Role in the workflow: foundational libraries rank above specialized ones.
  2. Adoption: monthly PyPI downloads and GitHub stars, read with care, since downloads also count installs by other packages.
  3. Maintenance: active means a release in the last 6 months, maintained one in the last 18; maintenance mode means no release in 18 months but ongoing code changes.
  4. Learning curve: the tiebreaker.

Every library here is free and open source, so price plays no part.

Choosing the Best Python Library

Start from the task in front of you, and move up from the default only when it stops being enough.

If you need...Go withWhy
Cleaning and analyzing a CSV or Excel filepandasThe default DataFrame, with the most tutorials and integrations.
A dataset too big for pandas on one machinePolarsLazy, multi-threaded queries that stream data larger than memory.
SQL over Parquet or CSV filesDuckDBAn in-process SQL engine that reads the files directly.
Your first predictive modelscikit-learnOne consistent API for every classical algorithm.
The most accurate model on a large tableXGBoostRegularized gradient boosting, strong on structured data.
Training or fine-tuning neural networksPyTorchThe framework most new models and research code use.
Questions over your own documentsLlamaIndexLoading, indexing, and retrieval built for RAG.

Most projects combine several of these, one or more per stage: loading and cleaning, exploring and plotting, modeling, deep learning, and language apps.

Each stage of a data science project has its own Python libraries

Two choices are closer than the table suggests. Stay with pandas while your data fits in memory, and switch to Polars when queries take minutes; our pandas vs Polars comparison has benchmarks. For deep learning, PyTorch suits research and open models, TensorFlow suits mobile and browser deployment, and Keras lets you defer the choice.

Final Verdict

Start with NumPy, pandas, Matplotlib, and scikit-learn; add PyTorch for deep learning, Polars or DuckDB when data outgrows pandas, and LangChain or LlamaIndex for LLM apps.

My pick for anyone starting out is pandas, because almost every other library here takes a DataFrame or hands one back. scikit-learn comes second: its fit-and-predict pattern carries over to XGBoost, LightGBM, and the AutoML libraries.

The core changes slowly, while the LLM libraries and the new compiled engines ship breaking releases every few months, so pin your versions. To learn the core libraries in order, take our Data Scientist in Python career track.

FAQs

What are the best Python libraries for data science in 2026?

The core 4 are NumPy for arrays, pandas for tables, Matplotlib for charts, and scikit-learn for machine learning. Add PyTorch for deep learning, Polars or DuckDB for data that outgrows pandas, XGBoost or LightGBM for accurate tabular models, and LangChain or LlamaIndex for LLM applications. All of them are free and open source.

Is Polars faster than pandas?

Yes, on most large datasets. Polars is written in Rust, runs queries on every CPU core, and optimizes lazy queries before executing them, so group-bys and joins on multi-gigabyte files often finish many times faster than in pandas. On small DataFrames the difference is negligible, and pandas still has the larger ecosystem of compatible libraries.

Is TensorFlow or PyTorch better for deep learning?

PyTorch is the better default in 2026: most research code and new pretrained models on Hugging Face use it, and its eager execution is easier to debug. TensorFlow remains strong for deployment to mobile, edge devices, and browsers through LiteRT and TensorFlow.js. Keras 3 runs on both, so you can postpone the choice.

How do I install Python data science libraries like NumPy and pandas?

Install them from PyPI with pip inside a virtual environment: run python3 -m venv .venv (python on Windows), activate it, then pip install numpy pandas matplotlib scikit-learn. Conda works too and handles non-Python dependencies such as CUDA. Pin versions in a requirements file, because pandas 3.0, Polars 2.0, and other 2026 releases changed their APIs.

Which Python library should I use to build LLM applications?

Use LangChain for chains, tool-calling agents, and switching between model providers, and LlamaIndex when the core problem is retrieving answers from your own documents (RAG). Both work with vector stores such as ChromaDB. To run or fine-tune open models yourself, use Hugging Face Transformers, and validate model outputs with Pydantic.

Which Python library should I learn first for data science?

Learn pandas first, with just enough NumPy to understand arrays. pandas is where you load, clean, and summarize data, and almost every other library on this list takes a DataFrame as input. Then add Matplotlib or Seaborn for charts and scikit-learn for your first models. Our Data Scientist in Python track covers them in that order.

Topics

Related

blog

The Best Data Science Courses to Take in 2026

⌂ 换网址