import pandas as pd
# Read the CSV file
df = pd.read_csv("demo_file.csv")
# Filter rows where 'Path' column contains "A/B/C"
filtered_df = df[df['Path'].str.contains("A/B/C")]
# Write the filtered dataframe to a new CSV file
filtered_df.to_csv("filtered_file.csv", index=False)
1条答案
按热度按时间xfb7svmp1#
我不能真正测试它,除非你提供CSV。但你可以试试这个: