Skip to content

Commit

Permalink
Merge pull request #638 from Teradata/anomalyEFS
Browse files Browse the repository at this point in the history
Updated the column names
  • Loading branch information
DallasBowden authored Jun 12, 2024
2 parents 4507a26 + f5e605e commit 72b55d4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
"from sqlalchemy import func\n",
"source_efs = input_source.merge(right=nb_points_efs, how='inner', on = 'Account_ID', lsuffix = 't1', rsuffix = 't2')\n",
"source_efs = source_efs.assign(drop_columns=True,\n",
" Account_ID = source_efs.Account_ID_t1,\n",
" Account_ID = source_efs.t1_Account_ID,\n",
" Balance_Date = source_efs.Balance_Date,\n",
" Monthly_Balance = source_efs.Monthly_Balance)\n",
"\n",
Expand Down Expand Up @@ -867,7 +867,7 @@
"# input_zscore_source = source_data[source_data.Balance_Date == business_date]\n",
"source_zscore = input_zscore_source.merge(right=mean_std_efs, how='inner', on = [\"ACCOUNT_ID = Account_ID\"], lsuffix = 't1', rsuffix = 't2')\n",
"source_zscore = source_zscore.assign(drop_columns=True,\n",
" Account_ID = source_zscore.ACCOUNT_ID_t1,\n",
" Account_ID = source_zscore.t1_ACCOUNT_ID,\n",
" Z_SCORE = (source_zscore.Monthly_Balance-source_zscore.MEAN_MONTHLY_BALANCE)\n",
" /source_zscore.STD_MONTHLY_BALANCE.nullifzero())\n",
"anomaly_dev = source_zscore.assign(ANOMALY_FLAG = case([(source_zscore.Z_SCORE.abs() > 3, 1)], else_ = 0) )\n",
Expand Down

0 comments on commit 72b55d4

Please sign in to comment.