Skip to content

Value types

The names below appear in the annotations and in the descriptions of the parameters. numdaplot does not export them, so ndp.ScalarValue does not exist: a parameter of one of these types takes the value itself.

ScalarValue = bool | int | float | str | date | datetime | timedelta | time Source

A single value: a boolean, a number, a text, a date, a datetime, a duration or a time of day.

It is a name used by the documentation and the annotations, not an object to create: pass the value itself, such as True, 10, 2.5, "Paris", date(2026, 1, 31), datetime(2026, 1, 31, 14, 30) or timedelta(days=1) or time(15, 35).

Added in version 0.1.0

Examples:

import numdaplot as ndp

countries = ndp.Array.from_list(["FR", "DE", "FR"])
countries.check(ndp.Equal("FR"))
# Array([ True, False,  True], dtype=BOOL)

OrderedValue = int | float | str | date | datetime | timedelta | time Source

A single value that can be ordered: a number, a text in alphabetical order, a date, a datetime, a duration or a time of day.

It is a name used by the documentation and the annotations, not an object to create: pass the value itself, such as 10, 2.5, "Paris", date(2026, 1, 31), datetime(2026, 1, 31, 14, 30) or timedelta(days=1) or time(15, 35).

Added in version 0.1.0

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([80, 120])
prices.select(ndp.Greater(100))
# Array([120], dtype=INT64)

ListValue = ScalarValue | None Source

A single value of a list given to Array.from_list: a ScalarValue, or None for a missing value.

It is a name used by the documentation and the annotations, not an object to create: pass the value itself, such as 10, "Paris" or None.

Added in version 0.1.0

Examples:

import numdaplot as ndp

ndp.Array.from_list([1.5, None])
# Array([1.5, nan], dtype=FLOAT64)

NestedValues = Sequence[ListValue] | Sequence[NestedValues] Source

A list of ListValue, or a list of lists nested to any depth, as Array.from_list reads it.

It is a name used by the documentation and the annotations, not an object to create: pass the value itself, such as [1, 2, 3], ["Paris", "Lyon"] or [[1, 2], [3, 4]].

Added in version 0.1.0

Examples:

import numdaplot as ndp

ndp.Array.from_list([[1, 2], [3, 4]]).shape
# Shape(dimensions=[2, 2])

FilePath = str | Path Source

The path of a file, as a text or a pathlib.Path.

It is a name used by the documentation and the annotations, not an object to create: pass the value itself, such as "sales.csv" or Path("data/sales.csv").

Added in version 0.1.0

Examples:

from pathlib import Path
from tempfile import TemporaryDirectory
import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon"])
sales = ndp.Table.from_arrays({"city": cities})
with TemporaryDirectory() as folder:
    sales.to_csv(Path(folder) / "sales.csv")
    ndp.Table.from_csv(Path(folder) / "sales.csv").column("city").to_list()
# ['Paris', 'Lyon']