DataFrame 筛选某列的数据
# 筛选某列包含A或B的数据 filtered_df = df[df['column_name'].str.contains('A|B')] # 筛选某列包含A和B的数据,且忽略大小写 filtered_df = df[df['column_name'].str.contains('A', case=False) & df['column_name'].str.contains('B', case=False)]
本文来自博客园,作者:OTAKU_nicole,转载请注明原文链接:https://www.cnblogs.com/nicole-zhang/p/17932672.html