-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNCUA_ACCT_Dictionary_SetUp.py
More file actions
27 lines (24 loc) · 1.12 KB
/
NCUA_ACCT_Dictionary_SetUp.py
File metadata and controls
27 lines (24 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 13 13:19:35 2018
@author: Kim Earl Lowell
"""
#%%
# Set up input of dictionary file. Dictionary will contain all ACCT-codes
# used in the KPIs as keys and the FS files in which they will be found as
# the look-up value.
inpath='C:/Analytics/DATA911/Arkatechture/NCUA_Data/NCUA_Data_Final/PYE_Test/'
# Set up the dictionary to know from which files to grab ACCTs. Infile 1 is
# the file that says which ACCTs are used to calculate which KPIs and
# also tells in which file an ACCT is located.
infile1='TargetKPI_TargetAccts.csv'
dfdict=pd.read_csv(inpath+ACprefix+infile1, usecols=['Account','AcctName','TableName'],
skipinitialspace=True)
# Eliminate duplicate lines. Because some ACCTs are sought in the previous year,
# we have to eliminate duplicates.
dfdict=dfdict.drop_duplicates()
# For ease of searching, make all accounts lowercase.
dfdict['Account']=dfdict['Account'].str.lower()
# Make first two characters of file lowercase.
dfdict['TableName']=dfdict['TableName'].str.replace('FS','fs')
# Create empty dictionary for ACCT/file information.