Ricky Robinson
Ricky Robinson

Reputation: 22903

3 dots and a comma in NumPy array display

I was printing one list of values in Python, when I got this:

[ 0.00020885  0.00021386  0.0002141  ...,  0.0501399   0.12051606
  0.12359095]

What is the problem here? The list should have at least size 20. What happened to the elements shown as ...?

Upvotes: 14

Views: 3778

Answers (1)

Sven Marnach
Sven Marnach

Reputation: 601809

The problem is that you are not printing a Python list, but a NumPy array. NumPy output can be configured using numpy.set_printoptions().

Data types matter. If you wonder about the behaviour of some object, first check its type.

Upvotes: 20

Related Questions