Thomas Iskandar
Thomas Iskandar

Reputation: 25

How to change shape from (10,50) into (10,)?

So my matrix A shape is (10,) and matrix B shape is (10,50). How can I change my matrix B shape from (10,50) into (10,) so that I can subtract it with my matrix A?

Upvotes: 0

Views: 80

Answers (1)

Ivan
Ivan

Reputation: 40668

You can do so by broadcasting theta to a two-dimensional array (here shaped (10, 1)):

>>> theta[:,None] - gamma

Upvotes: 1

Related Questions