So I have a rather large file that is broken down like this:
Claim | CPT Code | TOTAL_ALLOWED | CPT_CODE | NEW_PRICE | ALLOWED_DIFFERENCE |
---|---|---|---|---|---|
6675647 | 90887 | 120 | 90887 | 153 | difference |
The thing is, for my data set, the existing already paid data is 47K lines long, yet the CPT codes we are paying are 20 codes only. How would use Pandas/Numpy to have python look at the CPT code, find its match, and compare the TOTAL_ALLOWED with the NEW_PRICE to determine what is ultimately owed.
I think I have it with this, but I'm having an issue with having Python iterate through my list:
df['price_difference'] = np.where(df['LINE_TOTAL_ALLOWED'] == ((df['NEW_PRICE'])*15)), 0, df['LINE_TOTAL_ALLOWED'] - ((df['NEW_PRICE']*15))```
but so far, its giving me an error that the rows don't match.
Any help is appreciated!