Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python and only the Pandas library: 1) Assume a CSV file (named: absent.csv) contains records with the following headings: ID, Reason for absence, and

Using Python and only the Pandas library:

1) Assume a CSV file (named: absent.csv) contains records with the following headings: ID, Reason for absence, and Social smoker, Number of pets, Hours absent. Each column contains integer values and the 'Social smoker' column can be either a '1' or '0' (smoker or non-smoker, respectively).

a) Find the top 3 most common reasons for absence for the social smokers, and then do the same for the non-smokers. (If there is a tie for 3rd place, include all that tied for that position). You may NOT use any loops. Print the results.

b) Find the mean number of hours absent for the records of those who have no pets, then do the same for those who have more than one pet. Print the results.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

=+analysis, and social media communication audit

Answered: 1 week ago