python筛选excel特定列数据

# 需要匹配的文章类型
types = ['blog', 'report', 'commentary', 'research', 'article', 'video', 'publication']

# 遍历每个智库名称和主题
for think_tank in df['think_tank_name'].unique():
    for topic in df['type'].unique():
        # 筛选符合条件的行,并将文章内容合并为一个字符串
        temp_df = df[(df['art_type'].str.lower().isin(types))]

你可能感兴趣的:(excel,python,pandas)