Home > Back-end >  How to use where method in python when getting error everytime?
How to use where method in python when getting error everytime?

Time:03-16

I am trying to apply a .where function to this data frame so that it filters by pitch type, but am getting the error "Array conditional must be same shape as self" every-time. Never had this issue with any past data frames,

included an image of the error

as well as

an image of the column in the dataframe

CodePudding user response:

I'm not sure what are.equal_to is, but this should work for you:

fastball = march[march["TaggedPitchType"] == "Fastball"]
  • Related