我有很多限制 - 测试看起来像这样:
测试姓氏不为空
crimes = data.loc[data['Category'] == 'ASSAULT']
测试AddressLine1不为空
df = pandas.read_csv('csvfile.txt', index_col=False, header=0);
print df[df['Category'] == 'ASSAULT')] #To filter on the basis of single value.
print df[df['A'].isin(['ASSAULT','ROBBERY'])] ##To filter on the basis of multiple values.
很像这样。我的问题是,我可以以某种方式推广theese测试,所以我不必写相同的200次吗?把它放入程序或其他东西?