Question: In Python, using only Pandas and Numpy, solve the following problem (Note: You may NOT use any loops): 1. The column 'reason_code' in the file

In Python, using only Pandas and Numpy, solve the following problem (Note: You may NOT use any loops): 1. The column 'reason_code' in the file data.csv gives codes for discharges. Determine which codes (and the corresponding outcomes from the ID file, info.csv) resulted in no readmissions ('NO' under 'readmitted'). Then find the top-5 outcomes that resulted in readmissions, in terms of the percentage of times readmission was required. 

Sample data:

data.csv

id, gender, reason_code, readmitted

1, male, 3, NO

2, female, 2, NO

3, female, 5, >30

4, male, 1, NO

5, male, 2, >30

info.csv:

facility_id, name

123, Main

232, East

113, West

reason_code, outcome

1, transfer to another facility

2, hospice

3, expired

4, discharge to home

5, left AMA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!