koladata

Home
Overview
Fundamentals
Glossary
Cheatsheet
API Reference
Quick Recipes
Deep Dive
Common Pitfalls and Gotchas
Persistent Storage

View the Project on GitHub google/koladata

kd.tuples API

Operators to create tuples.

kd.tuples.get_namedtuple_field(namedtuple: NamedTuple, field_name: str | DataItem) -> Any

Returns the value of the specified `field_name` from the `namedtuple`.

Args:
  namedtuple: a namedtuple.
  field_name: the name of the field to return.

kd.tuples.get_nth(x: Any, n: SupportsIndex) -> Any

Returns the nth element of the tuple `x`.

Args:
  x: a tuple.
  n: the index of the element to return. Must be in the range [0, len(x)).

kd.tuples.namedtuple(**kwargs)

Aliases:

Returns a namedtuple-like object containing the given `**kwargs`.

kd.tuples.slice(start=unspecified, stop=unspecified, step=unspecified)

Returns a slice for the Python indexing syntax foo[start:stop:step].

Args:
  start: (optional) Indexing start.
  stop: (optional) Indexing stop.
  step: (optional) Indexing step size.

kd.tuples.tuple(*args)

Aliases:

Returns a tuple-like object containing the given `*args`.