Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Crosswalk
- import pandas as pd
- ## Read in the ScorecardDepartments
- ## Set index to False
- ambDF = pd.read_excel('ScorecardDepartments.xlsx','Departments',index=False)
- crossDF = pd.read_excel('Crosswalk.xlsx',index=False)
- ## Only select rows that have departments in the Scorecard
- ambDF = ambDF.loc[ambDF['Include in Scorecard'] == 'Y']
- ## Set Column Dept to int
- pd.to_numeric(ambDF['Dept'])
- ambDF = ambDF.sort_values(by=['Dept'])
- crossDF = crossDF.sort_values(by=['Dept'])
- ## Change Crosswalk Dept column to a list
- ## to use in comparison
- Departments = crossDF['Dept'].tolist()
- ## Create a new dataframe with just the
- ## the dept information
- changeRows = ambDF.loc[ambDF['Dept'].isin(Departments)]
Add Comment
Please, Sign In to add comment