Commit b8b0eeee authored by smileshy777's avatar smileshy777

20200331

parent 850ced25
...@@ -189,7 +189,10 @@ class PSIMonitor: ...@@ -189,7 +189,10 @@ class PSIMonitor:
# 分离数据. # 分离数据.
df_copy = self.mongo_df[[field, 'date_label', 'applied_type', 'applied_channel', 'applied_at']].copy() df_copy = self.mongo_df[[field, 'date_label', 'applied_type', 'applied_channel', 'applied_at']].copy()
if field == 'guomei_audit_info#creditScore':
df_copy[field] = df_copy[field].apply(lambda x: x if 0 < x < 1 else np.nan)
df_copy = df_copy[df_copy[field].notna()] df_copy = df_copy[df_copy[field].notna()]
if df_copy.shape[0] == 0: if df_copy.shape[0] == 0:
print('仍在空跑.') print('仍在空跑.')
return None return None
...@@ -343,7 +346,11 @@ class PSIMonitor: ...@@ -343,7 +346,11 @@ class PSIMonitor:
# 清洗数据. # 清洗数据.
def clean_data(data): def clean_data(data):
if pd.isnull(data):
return np.nan
try: try:
if data <= 0 or data > 999999:
return np.nan
return float(data) return float(data)
except: except:
return np.nan return np.nan
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment