pandas_uuid API#
- class pandas_uuid.BaseUuidArray#
Bases:
ExtensionArray,ABCBase class for
UuidArrayandArrowUuidArray.- abstractmethod classmethod random(size: int, *, rng: int | np.random.Generator | None = None, dtype: UuidDtype | None = None) Self#
Generate an array of random UUIDs.
Which version is generated comes from
dtype.version, defaulting to 4. Only versions 4 and 7 can be generated randomly.Examples
>>> UuidArray.random(2, rng=0)[0].version 4 >>> UuidArray.random(2, rng=0, dtype=UuidDtype("numpy", 7))[0].version 7
- class pandas_uuid.UuidArray(values: Iterable[UuidLike], *, copy: bool = False, dtype: UuidDtype | None = None)#
Bases:
BaseUuidArray,NumpyExtensionArrayExtension array for storing uuid data in a
numpy.ndarray.
- class pandas_uuid.ArrowUuidArray(values: Iterable[UuidLike | NAType | None] | pa.UuidArray | pa.ChunkedArray[pa.UuidScalar], *, dtype: UuidDtype | None = None)#
Bases:
BaseUuidArray,ArrowExtensionArrayExtension array for storing uuid data in a
pyarrow.ChunkedArray.
- class pandas_uuid.UuidDtype(storage: UuidStorage = <factory>, version: int | None = None)#
Bases:
ExtensionDtypePandas extension dtype for UUIDs.
- storage: UuidStorage#
Storage kind, either
"numpy"or"pyarrow".
- type pandas_uuid.UuidStorage = Literal['numpy', 'pyarrow']#
Supported storage backend for
UuidDtype.
- type pandas_uuid.UuidLike = UUID | UuidScalar | bytes | int | str#
Supported element types when creating a
BaseUuidArrayfrom a sequence.