Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteFor a regular Python list, use print(my_array). If by “array” you mean a NumPy array or Python’s array.array, you can also print the object directly, but the displayed format differs. The examples below show how to identify the type you have and choose the output you want.
Print a Python list
Lists are the usual sequence beginners mean when they say “array.” Pass the list to print() to display its Python representation, including square brackets and commas:
my_array = [1, 2, 3, 4]
print(my_array)
# [1, 2, 3, 4]
Python’s built-in print() converts supplied objects to text and writes them to standard output by default. When you pass multiple objects, it puts a space between them unless you choose a different sep; it ends the output with a newline unless you change end. See the Python built-in functions documentation.
Print elements without the list brackets
Use the unpacking operator * to pass each list item to print() separately. Set sep to choose what appears between items:
#1 Best Overall
print(*my_array, sep=", ")
# 1, 2, 3, 4
For a label or a particular number format, build the text explicitly. This example formats numeric values to two decimal places:
print("Values:", ", ".join(f"{value:.2f}" for value in my_array))
The .2f format expects numbers; it is not a default format applied to every Python value.
Rank #2
Check which kind of array you have
Python has more than one object that may be called an array. Choose the display method based on the actual type:
| Type | What to do | What to expect |
|---|---|---|
| Python list | Use print(values), or print(*values, sep=", ") for separated items. |
The ordinary representation includes brackets and commas; unpacking prints the items separately. |
array.array |
Print the object directly, or call .tolist() for a list representation. |
It is a standard-library sequence constrained to a type code. See the Python array documentation. |
NumPy ndarray |
Use print(arr). |
NumPy lays out values according to the array’s dimensions; its display is not a conversion to nested Python lists. See the NumPy quickstart. |
Display a NumPy array or matrix
Print a NumPy array directly. For example, a two-dimensional array displays as a matrix:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
import numpy as np
arr = np.array([[1, 2], [3, 4]])
print(arr)
# [[1 2]
# [3 4]]
NumPy’s display uses spaces between values rather than the commas shown in a Python list. One-dimensional arrays appear as rows; higher-dimensional arrays are grouped into slices. This is NumPy’s representation layout, not a change to the underlying array.
Make nested Python data easier to read
For nested built-in structures such as lists and dictionaries, use pprint.pp() when line breaks and indentation make the output easier to inspect:
from pprint import pp
nested = [[1, 2, 3], [4, 5, 6]]
pp(nested, width=20)
The pprint module keeps structures on one line when they fit and breaks them across lines when needed. Its width, indentation, depth, and compactness can be configured. It is intended for Python data structures; for ndarray display, adjust NumPy’s own print options instead. See the Python pprint documentation.
Control how NumPy formats large arrays and numbers
Show more or all elements
NumPy abbreviates large arrays with an ellipsis, showing edges rather than every value. The documented default summarization threshold is 1000 elements. To request the full representation, set a higher threshold, such as sys.maxsize:
Recommended Free Tools
Best Value
import sys
import numpy as np
np.set_printoptions(threshold=sys.maxsize)
print(np.arange(10000))
Printing every element of a very large array can overwhelm a terminal or log. NumPy documents threshold and set_printoptions() in its API reference.
Limit displayed decimal places or suppress scientific notation
Use np.printoptions() as a context manager when you want a formatting override to apply only within a block:
with np.printoptions(precision=2, suppress=True):
print(arr)
precision controls displayed floating-point precision, while suppress=True avoids scientific notation for small values. NumPy also offers settings for threshold, line width, representations of NaN and infinity, and type-specific formatters. These settings affect ndarray display, not the formatting of standalone scalar values. See the NumPy printing guide and the NumPy print-options reference.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




