Python Pandas Dataframe无法过滤所有有效记录

我有一个CSV文件,如下所示:

source,rule_expression,tag,tag_type
yarn_obj,table_dir like '%experiments%',Development,Engineering
Yarn,QueueName like 'Ft%',HR,test
Yarn​,QueueName like 'Fin%'​,Finance​,Subject Area​
Yarn​,QueueName like 'HR%'​,HR​,Subject Area​
Yarn​,QueueName like '%ETL%'​,ETL​,Worktype​
Yarn​,QueueName like '%DS%'​,Data Science​,Worktype​
Yarn​,Priority <> High and ExecutionTime > 3600​,Long running low value​,TimeValue​
Yarn​,Priority = High and ExecutionTime < 100​,Short running High value​,TimeValue​
HDFS​,Path like /datalake/Telco​,Telecom​,Subject Area​
Hive​,Table like manu%​,Manufacturing​,Subject Area​

我正在尝试使用pandas进行阅读(仅需使用Pandas,这是项目要求)。我面临的问题是Filter相等运算符无法正常工作。

CSV文件中的数据是从Microsoft PPT复制而来的,我想过滤“纱线”。熊猫过滤器只能过滤一条记录,而有7条记录。 Python代码是:

import pandas as pd

ruleDf = pd.read_csv("ScalarExpressions.csv", header="infer", encoding="utf-8")
print(ruleDf.info())
tes = ruleDf["source"].astype(str) == "Yarn"
print(tes)
print("__________")
yarnRules = ruleDf[tes]
print(yarnRules.head())
print("__________")
print(ruleDf["source"].head())

输出是

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 10 entries, 0 to 9       
Data columns (total 4 columns):      
source             10 non-null object
rule_expression    10 non-null object
tag                10 non-null object
tag_type           10 non-null object
dtypes: object(4)
memory usage: 448.0+ bytes
None
0    False
1     True
2    False
3    False
4    False
5    False
6    False
7    False
8    False
9    False
Name: source, dtype: bool
__________
  source       rule_expression tag tag_type
1   Yarn  QueueName like 'Ft%'  HR     test
__________
0    yarn_obj
1        Yarn
2       Yarn​
3       Yarn​
4       Yarn​
Name: source, dtype: object

任何帮助或指示将是非常可贵的。