社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

每次出错时,如何在python中使用where方法?

John Doe • 4 年前 • 2163 次点击  

我想申请一份工作 .where 函数对该数据帧进行过滤,以便按基音类型进行过滤,但每次都会出现错误“数组条件必须与自身形状相同”。以前的任何数据帧都没有这个问题,

included an image of the error

以及

an image of the column in the dataframe

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/129004
文章 [ 1 ]  |  最新文章 4 年前
richardec
Reply   •   1 楼
richardec    4 年前

我不确定是什么 are.equal_to 是的,但这应该对你有用:

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