pyarrow.lib.Int64Array

class pyarrow.lib.Int64Array

Bases: pyarrow.lib.IntegerArray

__init__()

Initialize self. See help(type(self)) for accurate signature.

Methods

cast(self, target_type[, safe]) Cast array values to another data type
dictionary_encode(self) Compute dictionary-encoded representation of array
equals(self, Array other)
from_pandas(obj[, mask, type]) Convert pandas.Series to an Arrow Array, using pandas’s semantics about what values indicate nulls.
isnull(self)
slice(self[, offset, length]) Compute zero-copy slice of this array
to_pandas(self, …[, zero_copy_only]) Convert to an array object suitable for use in pandas
to_pylist(self) Convert to an list of native Python objects.
unique(self) Compute distinct elements in array
validate(self) Perform any validation checks implemented by arrow::ValidateArray.
cast(self, target_type, safe=True)

Cast array values to another data type

Parameters:
  • target_type (DataType) – Type to cast to
  • safe (boolean, default True) – Check for overflows or other unsafe conversions
Returns:

casted (Array)

dictionary_encode(self)

Compute dictionary-encoded representation of array

equals(self, Array other)
from_pandas(obj, mask=None, type=None, MemoryPool memory_pool=None)

Convert pandas.Series to an Arrow Array, using pandas’s semantics about what values indicate nulls. See pyarrow.array for more general conversion from arrays or sequences to Arrow arrays

Parameters:
  • sequence (ndarray, Inded Series) –
  • mask (array (boolean), optional) – Indicate which values are null (True) or not null (False)
  • type (pyarrow.DataType) – Explicit type to attempt to coerce to, otherwise will be inferred from the data
  • memory_pool (pyarrow.MemoryPool, optional) – If not passed, will allocate memory from the currently-set default memory pool

Notes

Localized timestamps will currently be returned as UTC (pandas’s native representation). Timezone-naive data will be implicitly interpreted as UTC.

Returns:
  • array (pyarrow.Array or pyarrow.ChunkedArray (if object data)
  • overflows binary buffer)
isnull(self)
null_count
slice(self, offset=0, length=None)

Compute zero-copy slice of this array

Parameters:
  • offset (int, default 0) – Offset from start of array to slice
  • length (int, default None) – Length of slice (default is until end of Array starting from offset)
Returns:

sliced (RecordBatch)

to_pandas(self, bool strings_to_categorical=False, zero_copy_only=False)

Convert to an array object suitable for use in pandas

Parameters:
  • strings_to_categorical (boolean, default False) – Encode string (UTF8) and binary types to pandas.Categorical
  • zero_copy_only (boolean, default False) – Raise an ArrowException if this function call would require copying the underlying data

See also

Column.to_pandas(), Table.to_pandas(), RecordBatch.to_pandas()

to_pylist(self)

Convert to an list of native Python objects.

type
unique(self)

Compute distinct elements in array

validate(self)

Perform any validation checks implemented by arrow::ValidateArray. Raises exception with error message if array does not validate

Raises:ArrowInvalid