array2string
Return a string representation of an array with full control over formatting.
Returns:
string — Formatted string representation of the array.
array_repr
Return the string representation of an array, including thearray(...) wrapper, dtype, and shape information. This is what toString() uses internally.
Returns:
string — A string like array([[1, 2], [3, 4]]).
array_str
Return a string representation of the data in an array, without thearray(...) 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 bytoString() and array2string.
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 totoString(), 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.