Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Work with Scientific Data Format files in Python

Project Description

SDF is a Python package to read, write and interpolate multi-dimensional data. The Scientific Data Format is an open file format based on HDF5 to store multi-dimensional data such as parameters, simulation results or measurements. It supports…

  • very large files
  • up to 32 dimensions
  • hierarchical structure
  • units, comments and custom meta-information

For detailed information see the SDF specification.


To install the latest release from PyPI or update an existing installation:

python -m pip install --upgrade sdf

To install the latest development version:

python -m pip install --upgrade


Import the SDF and NumPy packages:

>>> import sdf
>>> import numpy as np

Create the data arrays:

>>> t = np.linspace(0, 10, 51)
>>> v = np.sin(t)

Create the datasets:

>>> ds_t = sdf.Dataset('t', data=t, unit='s', is_scale=True, display_name='Time')
>>> ds_v = sdf.Dataset('v', data=v, unit='V', scales=[ds_t])

Create the root group and write the file:

>>> g = sdf.Group('/', comment='A sine voltage', datasets=[ds_t, ds_v])
>>>'sine.sdf', g)

Read the dataset from the SDF file asserting the correct unit of the dataset and scale:

>>> ds_v2 = sdf.load('sine.sdf', '/v', unit='V', scale_units=['s'])

Get the meta info and data array from the dataset:

>>> ds_v2.unit

Get the scale for the first dimension:

>>> ds_t2 = ds_v2.scales[0]
>>> ds_t2.unit

© 2017 Dassault Systèmes

Release History

This version
History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(142.1 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Dec 13, 2017
(148.6 kB) Copy SHA256 Hash SHA256
Source None Dec 15, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting