cudf.pandas#

cuDF pandas accelerator mode (cudf.pandas) is built on cuDF and accelerates pandas code on the GPU. It supports 100% of the Pandas API, using the GPU for supported operations, and automatically falling back to pandas for other operations.

%load_ext cudf.pandas
# pandas API is now GPU accelerated

import pandas as pd

df = pd.read_csv("filepath")  # uses the GPU!
df.groupby("col").mean()  # uses the GPU!
df.rolling(window=3).sum()  # uses the GPU!
df.apply(set, axis=1)  # uses the CPU (fallback)
../_images/colab.png

Try it on Google Colab!#

Zero Code Change Acceleration

Just %load_ext cudf.pandas in Jupyter, or pass -m cudf.pandas on the command line.

Third-Party Library Compatible

cudf.pandas is compatible with most third-party libraries that use pandas.

Run the same code on CPU or GPU

Nothing changes, not even your import statements, when going from CPU to GPU.

100% of the Pandas API

Combines the full flexibility of Pandas with blazing fast performance of cuDF

Enable from the JupyterLab toolbar, no %load_ext needed

With the jupyterlab-nvdashboard extension, you can turn cudf.pandas on for a notebook from the GPU Accel toolbar menu, without adding %load_ext cudf.pandas or editing a single cell. See JupyterLab Usage with jupyterlab-nvdashboard for setup instructions.

cudf.pandas is available as part of the cudf package. See the installation and deployment guide to get up-and-running with cuDF.

See Usage for other ways to enable cudf.pandas, including from the command line and programmatically with cudf.pandas.install().