Question
Create a new Python file in this folder called Report.py. Create a DataFrame that contains the data in balance.txt. Write the code needed to produce
Create a new Python file in this folder called Report.py. Create a DataFrame that contains the data in balance.txt. Write the code needed to produce a report that provides the following information: Compare the average income based on ethnicity. On average, do married or single people have a higher balance? What is the highest income in our dataset? What is the lowest income in our dataset? How many cards do we have recorded in our dataset? (Hint: use sum()) How many females do we have information for vs how many males? (Hint: use count().
# Please this program should be working with Jupyter Notebook Python 3. Many thanks
balance.txt
"Balance" "Income" "Limit" "Rating" "Cards" "Age" "Education" "Gender" "Student" "Married" "Ethnicity" 12.2407984760474 14.891 3606 283 2 34 11 " Male" "No" "Yes" "Caucasian" 23.2833339223376 106.025 6645 483 3 82 15 "Female" "Yes" "Yes" "Asian" 22.5304088790893 104.593 7075 514 4 71 11 " Male" "No" "No" "Asian" 27.652810710665 148.924 9504 681 3 36 11 "Female" "No" "No" "Asian" 16.8939784904888 55.882 4897 357 2 68 16 " Male" "No" "Yes" "Caucasian" 22.4861776123913 80.18 8047 569 4 77 10 " Male" "No" "No" "Caucasian" 10.5745164367595 20.996 3388 259 2 37 12 "Female" "No" "No" "African American" 14.5762043512884 71.408 7114 512 2 87 9 " Male" "No" "No" "Asian" 7.93809029500252 15.125 3300 266 5 66 13 "Female" "No" "No" "Caucasian" 17.7569648697007 71.061 6819 491 3 41 19 "Female" "Yes" "Yes" "African American" 13.9949895332887 63.095 8117 589 4 30 14 " Male" "No" "Yes" "Caucasian" 9.46730770559351 15.045 1311 138 3 64 16 " Male" "No" "No" "Caucasian" 19.2188003192702 80.616 5308 394 1 57 7 "Female" "No" "Yes" "Asian" 10.6989837394764 43.682 6922 511 1 49 9 " Male" "No" "Yes" "Caucasian" 9.8935329738685 19.144 3291 269 2 75 13 "Female" "No" "No" "African American" 10.0451281331114 20.089 2525 200 3 57 15 "Female" "No" "Yes" "African American" 15.2487719488059 53.598 3714 286 3 73 17 "Female" "No" "Yes" "African American" 12.9608847484275 36.496 4378 339 3 69 15 "Female" "No" "Yes" "Asian" 11.5737780507057 49.57 6384 448 1 28 9 "Female" "No" "Yes" "Asian" 13.2362489323396 42.079 6626 479 2 44 9 " Male" "No" "No" "Asian" 9.85310041025905 17.7 2860 235 4 63 16 "Female" "No" "No" "Asian" 13.5957760154926 37.348 6378 458 1 72 17 "Female" "No" "No" "Caucasian" 9.41650943913943 20.103 2631 213 3 61 10 " Male" "No" "Yes" "African American" 16.3025334226814 64.027 5179 398 5 48 8 " Male" "No" "Yes" "African American" 6.16094815301471 10.742 1757 156 3 57 15 "Female" "No" "No" "Caucasian" 8.23251395126329 14.09 4323 326 5 25 16 "Female" "No" "Yes" "African American" 14.9599155392518 42.471 3625 289 6 44 12 "Female" "Yes" "No" "Caucasian" 12.6084607656599 32.793 4534 333 2 44 16 " Male" "No" "No" "African American" 35.2710114972418 186.634 13414 949 2 41 14 "Female" "No" "Yes" "African American" 14.0077695908343 26.813 5611 411 4 55 16 "Female" "No" "No" "Caucasian" 10.2015234846867 34.142 5666 413 4 47 5 "Female" "No" "Yes" "Caucasian" 11.4648640844397 28.941 2733 210 5 43 16 " Male" "No" "Yes" "Asian" 26.0394160554616 134.181 7838 563 2 48 13 "Female" "No" "No" "Caucasian" 10.0513152757805 31.367 1829 162 4 30 10 " Male" "No" "Yes" "Caucasian" 9.25014451816775 20.15 2646 199 2 25 14 "Female" "No" "Yes" "Asian" 10.246078096443 23.35 2558 220 3 49 12 "Female" "Yes" "No" "Caucasian" 16.8762191761561 62.413 6457 455 2 71 11 "Female" "No" "Yes" "Caucasian" 11.1262032234615 30.007 6481 462 2 69 9 "Female" "No" "Yes" "Caucasian" 8.51728206604637 11.795 3899 300 4 25 10 "Female" "No" "No" "Caucasian" 7.62376226785467 13.647 3461 264 4 47 14 " Male" "No" "Yes" "Caucasian" 12.0296459859284 34.95 3327 253 3 54 14 "Female" "No" "No" "African American" 25.2910079551984 113.659 7659 538 2 66 15 " Male" "Yes" "Yes" "African American" 13.1236688982086 44.158 4763 351 2 66 13 "Female" "No" "Yes" "Asian" 12.3199761360851 36.929 6257 445 1 24 14 "Female" "No" "Yes" "Asian" 12.0595956259441 31.861 6375 469 3 25 16 "Female" "No" "Yes" "Caucasian" 18.6536612419752 77.38 7569 564 3 50 12 "Female" "No" "Yes" "Caucasian" 10.8058246875595 19.531 5043 376 2 64 16 "Female" "Yes" "Yes" "Asian" 11.4885652436606 44.646 4431 320 2 49 15 " Male" "Yes" "Yes" "Caucasian" 13.4334683643406 44.522 2252 205 6 72 15 " Male" "No" "Yes" "Asian" 14.0076325274317 43.479 4569 354 4 49 13 " Male" "Yes" "Yes" "African American" 10.1073556011089 36.362 5183 376 3 49 15 " Male" "No" "Yes" "African American" 13.0107676261896 39.705 3969 301 2 27 20 " Male" "No" "Yes" "African American" 11.924342231818 44.205 5441 394 1 32 12 " Male" "No" "Yes" "Caucasian" 9.72819204081147 16.304 5466 413 4 66 10 " Male" "No" "Yes" "Asian" 7.66566199430089 15.333 1499 138 2 47 9 "Female" "No" "Yes" "Asian" 11.4543371959078 32.916 1786 154 2 60 8 "Female" "No" "Yes" "Asian" 17.05369062475 57.1 4742 372 7 79 18 "Female" "No" "Yes" "Asian" 18.1554884853513 76.273 4779 367 4 65 14 "Female" "No" "Yes" "Caucasian" 9.18079694095874 10.354 3480 281 2 70 17 " Male" "No" "Yes" "Caucasian" 16.4240947050359 51.872 5294 390 4 81 17 "Female" "No" "No" "Caucasian" 13.2972825293155 35.51 5198 364 2 35 20 "Female" "No" "No" "Asian" 10.0323162365919 21.238 3089 254 3 59 10 "Female" "No" "No" "Caucasian" 10.9872363907336 30.682 1671 160 2 77 7 "Female" "No" "No" "Caucasian" 9.52966274892709 14.132 2998 251 4 75 17 " Male" "No" "No" "Caucasian"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started