A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrow.apache.org/docs/python/api/../generated/pyarrow.binary.html below:

pyarrow.binary — Apache Arrow v20.0.0

pyarrow.binary#
pyarrow.binary(int length=-1)#

Create variable-length or fixed size binary type.

Parameters:
lengthint, optional, default -1

If length == -1 then return a variable length binary type. If length is greater than or equal to 0 then return a fixed size binary type of width length.

Examples

Create an instance of a variable-length binary type:

>>> import pyarrow as pa
>>> pa.binary()
DataType(binary)

and use the variable-length binary type to create an array:

>>> pa.array(['foo', 'bar', 'baz'], type=pa.binary())
<pyarrow.lib.BinaryArray object at ...>
[
  666F6F,
  626172,
  62617A
]

Create an instance of a fixed-size binary type:

>>> pa.binary(3)
FixedSizeBinaryType(fixed_size_binary[3])

and use the fixed-length binary type to create an array:

>>> pa.array(['foo', 'bar', 'baz'], type=pa.binary(3))
<pyarrow.lib.FixedSizeBinaryArray object at ...>
[
  666F6F,
  626172,
  62617A
]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4