Create a Python program, with associated comments to make the code understandable, which analyzesa medical dataset loaded in a Pandas dataframe. The dataset contains the variables provided on this documentation page:https://vincentarelbundock.github.io/Rdatasets/doc/Ecdat/DoctorContacts.html(Links to an external site.).
An iPython notebook is provided with comments asking for the tasks to complete, with associated output. It is attached both as a notebook and a Python script.
Your taskconsists in providing the code associated with the comments, which is summarized here (see similar example in the worksheet for week5):
1)read the dataset from https://vincentarelbundock.github.io/Rdatasets/csv/Ecdat/DoctorContacts.csvinto 'medical' variable.
2) view Some of the Rows in the Medical Dataset (for example first 2 rows)
3) format numbers to be displayed with two decimal positions
4) view first 5 rows in the Medical Dataset
5) view last 5 rows in the Medical Dataset
6) customize the Column Names:add a name for the first column, for example id# hint: assign name using the index of the column ix with: medical.columns.values[ix] = 'id'
7) medical.head()
8) provide descriptive statistics of all variables in this dataset
9) provide descriptive statistics for the patients in excellent health
10)get_ipython().run_line_magic('matplotlib', 'inline')
11) draw histogram for variable 'educdec'
12) draw a histogram comparing education level (educdec) by gender# hint: use the parameter by='variable name' in hist()histogram = medical.hist(column='educdec',by='sex')
13) access column 'child' of the dataframe in two manners
15) select the first row of the dataset
16) slice the dataset to extract the first 10 rows
17) slice the dataset to extract the first 10 rows and only columns 'health' and 'educdec'
18) display the health status of patient with id 9
`9) sort the dataset by increasing value of column 'age'# hint: use 'by' argument in sort_value method
20) sort the dataset by decreasing value of column 'age'
Turn in your program as an attached iPythonnotebook (.ipynbextension), or as an attached Python file (.py extension).