Python 为子组选择特定信息

Python 为子组选择特定信息,python,Python,我对编码还是新手,不确定是否使用了正确的术语。我想从列中选择特定数据 我看了一遍作业笔记,想找个例子,但找不到 TV = show[show.Group == ['Lost', 'Simpsons', 'Family Guy']] if other.ndim != 0 and len(self) != len(other): raise ValueError('Lengths must match to compare') 如果我没弄错的话,你在用熊猫。 因此,为了访问某些列中具有精

我对编码还是新手,不确定是否使用了正确的术语。我想从列中选择特定数据

我看了一遍作业笔记,想找个例子,但找不到

TV = show[show.Group == ['Lost', 'Simpsons', 'Family Guy']]

if other.ndim != 0 and len(self) != len(other):
    raise ValueError('Lengths must match to compare')

如果我没弄错的话,你在用熊猫。 因此,为了访问某些列中具有精确值的行,您可以执行以下代码:

TV = show[show.Group == 'Family Guy']
where Group是搜索值“Family Guy”的列。
因此,这段代码返回“Group”列中所有值为“Family Guy”的行。

您面临的问题是什么?有错误吗?输出是什么?这是错误:
if other.ndim!=0和len(self)!=len(其他):
raisevalueerror(“长度必须匹配才能进行比较”)
如果我得到了关于此命令的定义,这会有所帮助。我通过网上学校学习。你能分享什么是“秀”吗?