import pandas as pd
# Change the below file name with your CSV file name
df = pd.read_csv('your_file.csv')
# Create a Boolean mask
mask = df['your_column'].str.endswith('05')
# Use the above created mask to filter the data in the new dataframe
filter_df = df[mask]
# Display the filtered dataframe
print(filtered_df)
1条答案
按热度按时间csga3l581#
为此,您可以使用 endswith 在新的dataframe中过滤数据,如下所示: