towhee.dataframe.array.array.Array

class towhee.dataframe.array.array.Array(data=None, name: Optional[str] = None)[source]

Bases: object

One-dimensional array of data

Parameters:
  • data (numpy.ndarray, list, dict or scalar) – Contains data to be stored in Array.

  • dtype (numpy.dtype, str, PIL.Image or towhee.DType, optional) – Data type of the Array. If not specified, it will be inferred from data.

  • name (str) – Name of the Array.

  • copy (bool, default False) – Copy the data contents to the Array.

Methods

append

Append a list-like items to the end of this Array.

clear

gc

Release the unreferenced lower part of the Array up to the index but not including.

get_relative

is_empty

Indicator whether Array is empty.

put

Append one item to the end of this Array.

set_name

Attributes

data

Data of the Array

name

Name of the Array'.

size

Total number of elements in the Array since creation.

__init__(data=None, name: Optional[str] = None)[source]
__repr__()[source]

Return repr(self).

append(data)[source]

Append a list-like items to the end of this Array.

Parameters:

data (list or Array) – The data to be appended.

property data: List

Data of the Array

gc(offset)[source]

Release the unreferenced lower part of the Array up to the index but not including.

is_empty() bool[source]

Indicator whether Array is empty.

Returns:

(bool)

Return True if Array has no elements.

property name: str

Name of the Array’.

put(item)[source]

Append one item to the end of this Array.

property size: int

Total number of elements in the Array since creation.