NPZ

Overview: NPZ

class NPZ(fp: Union[str, os.PathLike], mode: str = 'r')[source]

Utility object for reading characteristics from, or writing new, NPZ files from arrays or Frame.

NPZ: Constructor

Overview: NPZ: Constructor

NPZ.__init__(fp: Union[str, os.PathLike], mode: str = 'r') None
NPZ.from_arrays(blocks: Iterable[numpy.ndarray], *, index: Optional[Union[static_frame.core.index_base.IndexBase, Iterable[Hashable], Iterable[Sequence[Hashable]]]] = None, columns: Optional[Union[static_frame.core.index_base.IndexBase, Iterable[Hashable], Iterable[Sequence[Hashable]]]] = None, name: Optional[Hashable] = None, axis: int = 0) None

Given an iterable of arrays, write out an NPZ or NPY directly, without building up intermediary Frame. If axis 0, the arrays are vertically stacked; if axis 1, they are horizontally stacked. For both axis, if included, indices must be of appropriate length.

Parameters
NPZ.from_frames(frames: Iterable[Frame], *, include_index: bool = True, include_columns: bool = True, axis: int = 0, union: bool = True, name: Optional[Hashable] = None, fill_value: object = nan) None

Given an iterable of Frames, write out an NPZ or NPY directly, without building up an intermediary Frame. If axis 0, the Frames must be block compatible; if axis 1, the Frames must have the same number of rows. For both axis, if included, concatenated indices must be unique or aligned.

Parameters
  • frames

  • *

  • include_index

  • include_columns

  • axis

  • union

  • name

  • fill_value

NPZ: Constructor | Attribute | Method | Display | Operator Binary

NPZ: Attribute

Overview: NPZ: Attribute

NPZ.contents

Return a Frame indicating name, dtype, shape, and bytes, of Archive components.

NPZ.nbytes

Return numer of bytes stored in this archive.

NPZ: Constructor | Attribute | Method | Display | Operator Binary

NPZ: Method

Overview: NPZ: Method

NPZ.__enter__() static_frame.core.archive_npy.ArchiveComponentsConverter

When entering a context manager, a handle to this instance is returned.

NPZ.__exit__(type: Type[BaseException], value: BaseException, traceback: types.TracebackType) None

When exiting a context manager, resources are closed as necessary.

NPZ: Constructor | Attribute | Method | Display | Operator Binary

NPZ: Display

Overview: NPZ: Display

NPZ.interface

A Frame documenting the interface of this class.

NPZ.__repr__()

Return repr(self).

NPZ.__str__()

Return str(self).

NPZ: Constructor | Attribute | Method | Display | Operator Binary

NPZ: Operator Binary

Overview: NPZ: Operator Binary

NPZ.__eq__(value, /)

Return self==value.

NPZ.__ge__(value, /)

Return self>=value.

NPZ.__gt__(value, /)

Return self>value.

NPZ.__le__(value, /)

Return self<=value.

NPZ.__lt__(value, /)

Return self<value.

NPZ.__ne__(value, /)

Return self!=value.

NPZ: Constructor | Attribute | Method | Display | Operator Binary