通用代码!?!

时间:2017-02-18 11:09:02

标签: sql-server sql-server-2012

我有很多限制 - 测试看起来像这样:

测试姓氏不为空

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次吗?把它放入程序或其他东西?

0 个答案:

没有答案
相关问题