-2

I have the following array which has the dimension (4,1):

[0,0]
[0,1]
[1,0]
[1,1]

How can I convert it to a (4,2) dimension to look as follows?

[[0 0]
 [0 1]
 [1 0]
 [1 1]]

Thanks.

Simplicity
  • 47,404
  • 98
  • 256
  • 385

1 Answers1

2

There's a problem: your first "array" is not an array, it seems more like the output of 4 list objects.

Also the second "array" you wrote is not an array, look at this:

>>> [0 0]
SyntaxError: invalid syntax. Perhaps you forgot a comma?

If you mean you want the array to be printed like [0 0], then it's actually an array, since (thanks to @Wondercricket) numpy outputs the array like that.

FLAK-ZOSO
  • 3,873
  • 4
  • 8
  • 28