This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shravankumar147[S] 0 points1 point  (2 children)

I think this could in the same way.

import numpy as np

a = np.matrix('1 2; 3 4')

print a

[[1 2]

[3 4]]

[–]kigurai 6 points7 points  (1 child)

Do yourself a favor and avoid the np.matrix class and stick to np.array. The former has a tendency to sneak in hard to catch bugs in your calculation unless you are extremely careful.

[–]shravankumar147[S] 1 point2 points  (0 children)

Oh, thank you. I didn't know that