Skip to main content

NetCDF Format

Read NetCDF datasets as one record per index along a chosen dimension.

Overview

PropertyValue
Format idnc (alias netcdf)
ClassNetCDFIterable
Extensions.nc, .netcdf
ReadYes
WriteNo
Extranetcdf (netCDF4)
Maturitystable

Record shape

Keys are variable names; values are scalars or arrays for that dimension index:

{"time": "...", "temperature": 20.5, "lat": [...], "lon": [...]}

Parameters

ParameterDescription
dimensionDimension to iterate (default: unlimited, else first)

Requires a filename (or a named file object). list_tables() lists variables; totals() is the target dimension size.

Usage

from iterable import open_iterable

with open_iterable("climate.nc", format="nc") as source:
print(source.list_tables())
for row in source:
print(row)

with open_iterable(
"climate.nc",
format="nc",
iterableargs={"dimension": "time"},
) as source:
for row in source:
print(row)

Install with pip install iterabledata[netcdf].

See also