恢复样本3统计
This commit is contained in:
@@ -42,7 +42,7 @@ def sell_stat():
|
|||||||
'_id'].transform('size')
|
'_id'].transform('size')
|
||||||
sell_seaweed_merge_df = sell_seaweed_merge_df[['city', 'region', '_id', 'count']]
|
sell_seaweed_merge_df = sell_seaweed_merge_df[['city', 'region', '_id', 'count']]
|
||||||
sell_seaweed_merge_df = sell_seaweed_merge_df.drop_duplicates(subset=['city', 'region', '_id'])
|
sell_seaweed_merge_df = sell_seaweed_merge_df.drop_duplicates(subset=['city', 'region', '_id'])
|
||||||
sell_seaweed_ok_df = sell_seaweed_merge_df[sell_seaweed_merge_df['count'] > 0]
|
sell_seaweed_ok_df = sell_seaweed_merge_df[sell_seaweed_merge_df['count'] > 3]
|
||||||
sell_seaweed_ok_df['city_seaweed_count'] = sell_seaweed_ok_df.groupby('city')['city'].transform('size')
|
sell_seaweed_ok_df['city_seaweed_count'] = sell_seaweed_ok_df.groupby('city')['city'].transform('size')
|
||||||
city_seaweed_count_df = sell_seaweed_ok_df[['city', 'city_seaweed_count']].drop_duplicates(
|
city_seaweed_count_df = sell_seaweed_ok_df[['city', 'city_seaweed_count']].drop_duplicates(
|
||||||
subset=['city', 'city_seaweed_count'])
|
subset=['city', 'city_seaweed_count'])
|
||||||
@@ -77,7 +77,7 @@ def sell_stat():
|
|||||||
try:
|
try:
|
||||||
sql = "select count(*) from latest_seawater where city='" + city + "' and region='" + region + "' and cat='sell' and district_name in(" + names_str + ") and p_date > " + one_year_time
|
sql = "select count(*) from latest_seawater where city='" + city + "' and region='" + region + "' and cat='sell' and district_name in(" + names_str + ") and p_date > " + one_year_time
|
||||||
num = es206_client.search_by_sql(sql)['hits']['total']['value']
|
num = es206_client.search_by_sql(sql)['hits']['total']['value']
|
||||||
if num > 0:
|
if num > 3:
|
||||||
count += 1
|
count += 1
|
||||||
total_num += num
|
total_num += num
|
||||||
all_num += num
|
all_num += num
|
||||||
|
|||||||
Reference in New Issue
Block a user