Skip to main content

array2string

Return a string representation of an array with full control over formatting.
Returns: string — Formatted string representation of the array. prefix and suffix only reserve width: continuation lines are indented to clear prefix and suffix is subtracted from the line width, but neither string is added to the output.

array_repr

Return the string representation of an array, including the array(...) wrapper and a dtype= suffix for dtypes other than float64, int64, complex128, and bool.
Returns: string — A string like array([[1., 2.], [3., 4.]]).

array_str

Return a string representation of the data in an array, without the array(...) wrapper.
Returns: string — The array data as a string without the array() prefix.

base_repr

Return the string representation of a number in the given base.
Returns: string — String representation in the specified base.

binary_repr

Return the binary string representation of a number. Negative numbers use two’s complement notation.
Returns: string — Binary string representation.

format_float_positional

Format a floating-point scalar in positional (non-scientific) notation with fine-grained control.
Returns: string — Formatted number string.

format_float_scientific

Format a floating-point scalar in scientific notation.
Returns: string — Formatted scientific notation string.

get_printoptions

Return the current default print options used by toString() and array2string.
Returns: PrintOptions — An object with the current settings including precision, threshold, edgeitems, linewidth, suppress, and nanstr.

set_printoptions

Set the default print options globally. These affect all subsequent calls to toString(), array_repr, and array2string.
Returns: void

printoptions

Temporarily set print options and return a context object. This is useful as a scoped context manager for formatting.
Returns: { enter, exit, apply, _savedOptions } — Context helpers that apply and restore temporary print settings.