Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

python numpy ValueError: operands could not be broadcast together with shapes

Asked by Aryan Gupta Apr 10, 2021 4.0K views 1 answer
Share

About this question

In numpy, I have two "arrays", X is (m,n) and y is a vector (n,1)

using

X*y

I am getting the error

ValueError: operands could not be broadcast together with shapes (97,2) (2,1)
When (97,2)x(2,1) is clearly a legal matrix operation and should give me a (97,1) vector

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.