优化报错
This commit is contained in:
@@ -6,13 +6,8 @@ import pandas as pd
|
||||
import numpy as np
|
||||
import logging
|
||||
import os
|
||||
from elasticsearch import helpers
|
||||
import matplotlib.pyplot as plt
|
||||
import sys
|
||||
|
||||
from sklearn.mixture import GaussianMixture
|
||||
from sklearn.preprocessing import QuantileTransformer
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
es206_client = ElasticSearchClient(host='192.168.0.89', username='elastic', password='elasticsearch')
|
||||
@@ -29,7 +24,9 @@ def stat(city):
|
||||
"""
|
||||
计算消费潜力
|
||||
"""
|
||||
sql = "select id, city, region, name, total_price, estate_charge, estate_charge_fix, relative_price_ranking, avg_cost, consumption_rating, price_rating, consumption_score from community_summary where city='" + city + "'"
|
||||
sql = "select id, city, region, name, total_price, estate_charge, estate_charge_fix, relative_price_ranking, avg_cost, consumption_rating, price_rating, consumption_score from community_summary "
|
||||
if city is not None:
|
||||
sql += " where city = '" + city + "'"
|
||||
community_summary_df = es206_client.scan_by_sql_to_data_frame(sql)
|
||||
community_summary_df['diff'] = np.abs(community_summary_df['consumption_rating'] - community_summary_df['price_rating'])
|
||||
maybe_wrong_community = community_summary_df[community_summary_df['diff'] > 2]
|
||||
|
||||
Reference in New Issue
Block a user