Skip to main content

Extension pandas dtype and array for physical units.

Project description

Extension pandas dtype and array for physical units

Warning: Not fully compatible with pandas yet, especially not so for 1.0. Some operations may or may not work, while common ones should.


Originally created for PyCon CZ 2019 (and later BI Fórum Budapest / PyData Cambridge the same year).


pip install pandas-units-extensions

For development:

pip install -e .


import pandas as pd
import pandas_units_extension as _

temps = pd.DataFrame({
    "city": ["Prague", "Kathmandu", "Catania", "Boston"],
    "temperature": pd.Series([20, 22, 31, 16], dtype="unit[deg_C]")


df = pd.DataFrame({
    "distance": pd.Series([10, 12, 22, 18], dtype="unit[km]"),
    "time": pd.Series([50, 60, 120, 108], dtype="unit[min]")
speed = df["distance"] / df["time"]

See doc/units.ipynb for more.


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pandas-units-extension, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pandas-units-extension-0.1.0.tar.gz (9.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page