One instance this might happen is once you shot to plot through two vectors of various sizes. Speak you have an x vector of size 10 and a y vector of dimension 11, and also you try plot them through, y) as follows:

ValueError: shape mismatch: objects can not be broadcast to a solitary shape

The factor being the when plot you constantly expect to have actually the x coordinate and also y coordinate to come in pairs. If castle don’t have the very same length, matplotlib can’t figure out exactly how to plot it.

So once you gain this error, twin check your input to the plot functions and also make certain they space what you meant them to be.

You are watching: Shape mismatch: objects cannot be broadcast to a single shape

PS: Ever struggling extract html table or other comparable web data to an excel sheet or a csv document ? check out the isheet chrome extension here:

Share this:

Like this:

Like Loading...
Posted in UncategorizedTagged matplotlib, numpy, pandas, plot write-up navigation
Previous short article ValueError: can only compare identically-labeled Seriesobjects
Next short article ValueError: unconverted dataremains:

Leave a reply Cancel reply

Enter her comment here...

Fill in your details below or click an symbol to log in in:


Email (required) (Address never made public)
Name (required)

You room commenting using your account.(LogOut/Change)


You room commenting utilizing your Google account.(LogOut/Change)


You room commenting using your Twitter account.(LogOut/Change)


You are commenting utilizing your on facebook account.(LogOut/Change)


Connecting come %s

educate me of brand-new comments via email.

inform me of brand-new posts via email.

See more: How Do I Solve Tweedledum And Tweedledee Saw It Can You See It


Data evaluation Tools

Blog in ~
Sign me up
%d bloggers favor this: