🚀 Jumpstart 2027: Custom, Secure AI Workflows to Adopt Now. Reserve your spot →

Chris Parmer

Chris Parmer

2026-11-16

14 Python Libraries for Data Analysis, Finance, Science, and Engineering

TL;DR

  • This page lists 14 open-source Python packages that domain experts use to build data apps in science, engineering, finance, energy, and pharma, 13 of them with a full demo.
  • Each demo is built around one real app made with Dash and Plotly on public data, such as a vibration monitor in SciPy, a portfolio risk app in NumPy, or a drug safety app in DuckDB, with the prompts a coding agent needs to build it.
  • Coding agents now write most of the code, so what helps most is knowing which package does what and naming it in your prompt. This page is a map of that.
  • The packages are grouped by the job they do: loading and querying data, math and simulation, statistics and machine learning, and domain data types (gridded climate data, maps, networks, images, and single-cell data).
A grid of 13 Dash app screenshots, one per Python package: an ERCOT market report built with pandas, a taxi fleet app with Polars, a drug safety app with DuckDB, a portfolio risk app with NumPy, a vibration monitor with SciPy, an options Greeks app with SymPy, a macroeconomics app with statsmodels, a load forecast with scikit-learn, a wind and solar site map with xarray, a site screener with geopandas, a grid stress test with networkx, a cell imaging plate map with scikit-image and a single-cell atlas with scanpy

Coding agents have changed how people build data apps. A grid analyst, a risk manager, or a biologist can describe the app they want and get working Python back. What the agent still needs from you is direction: "use statsmodels SARIMAX with temperature as a regressor" gets you a better forecast than "predict the load". Knowing which package does what is most of that direction.

Each package below gets a short description of what it's for, one example app, and a link to its demo. Every demo runs on public data, shows the app in screenshots, and gives the prompts to rebuild it with Dash, Plotly's open-source framework for data apps in Python.

The groups on this page:

  • Load, clean, and query data: Polars, DuckDB, pandas, narwhals
  • Math, simulation, and engineering: NumPy, SciPy, SymPy
  • Statistics, forecasting, and machine learning: statsmodels, scikit-learn
  • Domain data types: xarray, geopandas, networkx, scikit-image, scanpy

Load, clean, and query data

Every app starts by getting data into tables: reading files, joining sources, aggregating by time, and filtering on what the user picks. For new apps we recommend Polars and DuckDB equally. Both can work through data larger than memory, read only the columns and rows a query needs, and use every core, so an app that starts on one month of data keeps working when it grows to five years. pandas remains the most widely used of the three and a good fit for existing code and smaller tables. Our comparison of DuckDB, Polars, and pandas has benchmarks on the same data.

Polars

Fleet Ops app built with Polars, Demand tab: 21,220,056 NYC yellow taxi trips from April to September 2026, $648.4 million in fares and a 14.6 minute median trip, with daily trips, Central Park rain and a weekday by hour heatmap

Polars is a dataframe library with a query engine written in Rust. You describe a query lazily, and Polars plans it, reads only the columns and row groups it needs, and runs it on every core; pl.sql runs SQL in the same app. Use it for apps over event and time series data such as trips, trades, meter reads, and sensor logs. The demo's fleet operations app answers each chart over 21.2 million taxi trips with a lazy query in a callback. For data in Google BigQuery, the Polars team's polars-bigquery connector sends your column choices and filters to BigQuery, and in our polars-bigquery demo that cut one read of NOAA weather data from 402.6 MB to 0.1 MB.

Read the Polars demo

DuckDB

Safety Signal Desk app built with DuckDB, showing 54,736 FDA adverse event reports that name semaglutide as a suspect drug: a scatter of 2,254 reaction terms by number of reports and proportional reporting ratio, with 530 signals in purple, and a table of the strongest signals

DuckDB is an in-process SQL database built for analytics, so there's no server to run. It queries Parquet, CSV, and JSON files where they are, keeps tables in a single file next to your app, and reads and returns Polars and pandas dataframes. Its SQL includes window functions, PIVOT, and ASOF JOIN. Use it for apps that run SQL over large files, from regulatory extracts to meter data. The demo's drug safety app loads 32.9 million rows of FDA adverse event reports and ranks the signals for any drug in under a second.

Read the DuckDB demo

pandas

ERCOT Market Report app built with pandas, Monthly report page for August 2026: average load 73.1 GW, peak load 90.8 GW, average hub price $35.45, wind and solar 36% of generation, with daily peak load bars against August 2025 and the daily average price

pandas is the dataframe library most Python data code is written in, with labeled columns, a time index, group-bys, joins, pivots, resampling, and rolling windows, and it has more examples and integrations than any other dataframe library. It works on data in memory, which covers most reports and models. The demo builds a market report for the Texas grid operator (ERCOT) that joins load, prices, the fuel mix, and weather on one hourly index, and caching the raw spreadsheets as Parquet took loading from 22.7 seconds for one year of prices to 0.05 seconds for all four tables.

Read the pandas demo

narwhals

Four identical histograms of June 2026 NYC yellow taxi trip length, each drawn by one Plotly Express call from a different input: a pandas DataFrame, a Polars DataFrame, a PyArrow Table and a DuckDB relation, built in 24 to 36 ms each

narwhals is a lightweight compatibility layer between dataframe libraries. A library written against it uses a subset of the Polars API and then accepts pandas, Polars, PyArrow, cuDF, and Modin dataframes, plus lazy inputs such as DuckDB, Ibis, and PySpark, without depending on any of them. You rarely call it yourself, but it's the reason the libraries you use accept whichever dataframe you pass: Plotly's Python library depends on it, and so does scikit-learn since 1.9. Above, one Plotly Express call draws the same histogram of 3.6 million taxi trips from four different inputs. The latest release, 2.29.0 (November 17, 2026), adds the Map data type and moves Dask support to a separate narwhals-dask plugin.

Math, simulation, and engineering

These packages do the numerical work behind engineering and finance apps: arrays and linear algebra, signal processing and optimization, and exact symbolic math.

NumPy

Risk Desk app built with NumPy, Overview tab: 1-day 99% value at risk of $1.90M, expected shortfall of $2.42M and SPY with 44% of the risk, a bar chart of weight against share of risk per ETF and a histogram of daily P&L

NumPy is the array library almost every scientific Python package is built on: fast math on whole arrays, linear algebra, random numbers, and percentiles. Use it for simulation and risk apps that recompute on every slider move. The demo's portfolio risk app runs 50,000 Monte Carlo paths in a callback over 11 exchange-traded funds (ETFs), and shows SPY carrying 44% of the risk with 30% of the money.

Read the NumPy demo

SciPy

Vibration Monitor app built with SciPy, Diagnosis page for an outer race bearing fault: an envelope spectrum with a tall peak at the defect frequency of 107.3 Hz and its harmonics, and a bar chart scoring the outer race at 244.3 times the background

SciPy adds the algorithms engineers and scientists reach for on top of NumPy: signal filtering and spectra, optimization, curve fitting, interpolation, statistics, and differential equations. Use it for monitoring, test, and lab apps on measured signals. The demo's vibration monitoring app flags all 36 damaged-bearing recordings in a public test set and none of the 4 normal ones, and names the damaged part correctly in 20 of the 36.

Read the SciPy demo

SymPy

Greeks Lab app built with SymPy, showing the Black-76 price formula and the gamma formula derived by SymPy next to a chart of gamma by strike for 204 out-of-the-money SPY options expiring December 18, 2026

SymPy does math with symbols instead of numbers: it differentiates, integrates, and solves equations exactly, then turns the results into fast NumPy functions. Use it for calculator and model apps where the formula matters as much as the answer. The demo derives option Greeks with SymPy and runs them on 8,484 SPY option quotes in 60 ms, within a median 0.09 volatility points of Cboe's published values.

Read the SymPy demo

Statistics, forecasting, and machine learning

These two packages cover modeling: statsmodels for statistical models you can explain and test, and scikit-learn for predictive models you validate on held-out data.

statsmodels

Macro Desk app built with statsmodels, Forecast page: a 12-month SARIMA forecast of U.S. utility output with 80% and 95% intervals, and a backtest of 69 one-month-ahead forecasts from January 2021 to September 2026 against the same month last year, with errors of 2.41% and 3.15%

statsmodels fits statistical and econometric models with full output: regressions with standard errors, time series models such as SARIMAX, vector autoregressions, cointegration tests, and seasonal decomposition. Use it for forecasting and economics apps where you need confidence intervals and tests, not only predictions. The demo's economics app runs on public Federal Reserve Economic Data (FRED), and its seasonal forecast of utility output was off by 2.41% on average over 69 months, against 3.15% for repeating the same month last year.

Read the statsmodels demo

scikit-learn

Model Desk app built with scikit-learn, Energy tab for the week of July 20, 2026: actual peak 91.1 GW, forecast peak 88.9 GW, 1.6% average error and 83% of hours inside the P10 to P90 band

scikit-learn is Python's standard library for machine learning on tables: one fit and predict API for regression, classification, clustering, preprocessing, and cross-validation. Use it for prediction apps where a model scores new data in a callback. The demo's five models include an hourly load forecast for Texas that was off by 2.1% on average in 2026, against 4.1% for repeating yesterday's load.

Read the scikit-learn demo

Domain data types

Some data doesn't fit in a flat table: gridded climate fields, shapes on a map, networks, microscope images, and single-cell measurements. Each of these packages gives that data a proper structure and the operations that go with it.

xarray

Site Scout app built with xarray, resource map: average daily wind speed at 50 m from 2001 to 2025 in 336 grid cells over Texas, strongest in the Panhandle, with Sweetwater selected and a table of the highest cells

xarray adds named dimensions and coordinates to multi-dimensional arrays, so you select by latitude, longitude, and date instead of by index, and read NetCDF and Zarr files from climate and weather models. Use it for weather, climate, and renewable energy apps. The demo's site assessment app runs on 25 years of NASA data over Texas and shows 2026 wind running 2.4% below normal across the region.

Read the xarray demo

geopandas

Site Screener app built with geopandas, Atlas tab: a hexagon map of wind capacity in megawatts on a log scale across the U.S., with the top 10 hexagons listed with every layer

geopandas adds geometry and coordinate systems to pandas, so spatial joins, buffers, overlays, and reprojection work like dataframe operations. Use it for siting, exposure, and territory apps. The demo's site screener joins public layers of 77,839 wind turbines, 89,691 clinical trial sites, county populations, and natural hazards, then screens the area around any spot in the lower 48 states in under 400 ms.

Read the geopandas demo

networkx

Stress Test app built with networkx, Grid tab: the minimum cut between Spain and Portugal and France on the European grid, 6,580 MVA through five links, shown in pink on a map and listed in a table

networkx is Python's standard library for graphs: things connected to other things, such as substations, companies, proteins, or airports, with algorithms for paths, flows, communities, and centrality. Use it for resilience, ownership, and supply chain apps. The demo's stress test app finds that the European grid can move at most 6,580 megavolt-amperes (MVA) from Spain and Portugal into France, through five links.

Read the networkx demo

scikit-image

Screen Lab app built with scikit-image, Plate tab: a plate map of 60 wells colored by nuclei per field, next to dose-response lines for taxol, nocodazole, aphidicolin and cytochalasin B

scikit-image is the image processing library of scientific Python: filters, thresholding, segmentation, and measurements of every object in an image. Use it for microscopy, inspection, and remote sensing apps. The demo's imaging app segments 33,001 cells across a public drug-screening plate and plots how each compound changes cell counts by dose.

Read the scikit-image demo

scanpy

Atlas Lab app built with scanpy, Atlas tab: a UMAP of 239,696 blood cells from five COVID-19 studies after Harmony integration, colored by study, with study mixing up from 0.166 to 0.411

scanpy analyzes single-cell gene expression data: quality control, normalization, clustering, embeddings such as UMAP, and marker genes for each cell type. Use it for translational and drug discovery apps in pharma and biotech. The demo's atlas app integrates 239,696 cells from five studies, and finds marker genes for 14 cell types in 45 seconds with scanpy 1.13, against 1,209 seconds with 1.12.

Read the scanpy demo

How to build apps with these packages

Start from the app, then name the packages. A prompt such as this one gives a coding agent both the use case and the tools:

Prompt: Build a Dash app with Plotly charts for a utility's grid planning team. Load hourly ERCOT load and weather with Polars, forecast the next 14 days with statsmodels SARIMAX using temperature as a regressor, and show the forecast with its 80% interval. Add a page that maps wind resource from a NetCDF file with xarray at any point the user clicks.

Most real apps combine several of these packages. A common pattern is Polars or DuckDB to load and filter, NumPy or SciPy for the math, statsmodels or scikit-learn for models, and Plotly for every chart. Each demo shows what's possible in plain words, with the function names to mention.

When the app is ready, you can deploy it to Plotly Cloud, or to Dash Enterprise on your company's own infrastructure, and share it with your team.

Coming from Power BI, Tableau, Spotfire, MATLAB, or SAS

Many domain experts already do this work in a business intelligence (BI) tool or in MATLAB or SAS. Most of what those tools do has an open-source Python package that covers the same ground, and in a Dash app those packages run in the same callback as the chart that shows the result.

If you use

for

In Python, ask for

Power BI Power Query, Tableau Prep, Spotfire data tables

Loading, joining, and reshaping data

Polars or DuckDB

Power BI DAX measures, Tableau calculated fields and LOD expressions, Spotfire calculated columns

Aggregations, time intelligence, running totals

Window functions in Polars or DuckDB

Power BI, Tableau, and Spotfire forecast lines

Forecasts with intervals

statsmodels (SARIMAX, exponential smoothing) or scikit-learn

Power BI Python and R scripts, Tableau TabPy, Spotfire data functions

Custom R or Python calculations

Any package on this page, called in a Dash callback

Power BI, Tableau, and Spotfire dashboards

Interactive charts, filters, and drill-downs

Dash and Plotly

MATLAB matrices and core math

Array math, linear algebra, simulation, Monte Carlo

NumPy

MATLAB Statistics and Machine Learning Toolbox

Distributions, regression, classification, clustering

SciPy (scipy.stats), statsmodels, and scikit-learn

MATLAB Signal Processing, Optimization, and Curve Fitting Toolboxes

Filters, spectra, fitting, optimization

SciPy

MATLAB Symbolic Math Toolbox

Derivatives, equations, closed-form models

SymPy

MATLAB Image Processing Toolbox

Filtering, segmentation, measurements

scikit-image

MATLAB Mapping Toolbox

Vector map data, projections, gridded rasters

geopandas and xarray

SAS DATA step and PROC SQL

Data preparation and queries

Polars or DuckDB

SAS PROC REG, PROC GLM, PROC LOGISTIC

Regression and statistical models

statsmodels

SAS PROC ARIMA

Time series models

statsmodels

The difference in a Dash app is where the math runs. A BI tool computes what its own formula language can express and calls out to R or Python for the rest, while in Dash the Python is the app, so a slider can rerun a SciPy filter, a statsmodels forecast, or a 50,000-path NumPy simulation, and the chart updates with the answer. All of these packages are free and open source, and Dash apps deploy to Plotly Cloud or to Dash Enterprise inside your company's network.

FAQ

bluesly
x
instagram
youtube
medium
fcaebook

Product

© 2026
Plotly. All rights reserved.
Cookie Preferences
aicpa/soc2