<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
Step1:  Summary Statistics - Examples
In these exercises you'll use a real life medical dataset to learn how to obtain basic statistics from the data. This dataset comes from Gluegrant, an American project that aims to find a which genes are more important for the recovery of severely injured patients! 
Dataset information
The dataset is a medical dataset with 184 patients, distributed into 2 test groups where each group divided in 2, patients and control.
The dataset is composed of clinical values
Step2:  The dimensions of the dataset are
Step3:  Let's take a look
Step4:  For those without biological background
You can consider that this dataset comes from a online shopping service like Amazon. Imagine that they were conducting an A/B test, where a small part of their website was changed, like the related items suggestions. You have 2 groups, the "control group" that is the group that is experiencing the original website (without modifications) and Group 1 that is using the website with the new suggestions.
Consider also that the genes are products or product categories where the customers buy a certain ammount of products. Your objective now is to find if there is a significant difference between the control group and Group 1.
Analysis to perform
Basic statistics on the differences between patients of differnet sexes.
Check what happened to the patients.
Check which genes are more or less expressed in the patients.
Age statistics for each of the sexes
Step5:  Quantiles
Step6:  There is almost no difference from the sexes! Really strange to see such close numbers...
Check out what happened to the patients
We have a column named Results that has the information of what happened to the patient. It has both happy and tragic information. Let's first check out how many results there are.
Step7:  Ok, we have 8 types of outcomes for the patients. One of them is control, ignore that, it's a problem with the dataset.
Let's check the numbers for each of these outcomes.
Step8:  Ok, so, good news, most of our patients survived the injury! 
Step9:  Looking at the mean, Gene4 seems to be a good one to predict the death of the patient, since it is much higher on the dead patients that in the alive ones.
But the median (50% in the tables) say otherwise, I smell something fishy, let's see the plot of the data!
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import numpy as np
from IPython.display import display, HTML
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
CSS = 
.output {
    flex-direction: row;
}
complete_data = pd.read_csv("../data/Exercises_Summary_Statistics_Data.csv")
complete_data = complete_data.set_index('Patient_id')
Explanation: Summary Statistics - Examples
In these exercises you'll use a real life medical dataset to learn how to obtain basic statistics from the data. This dataset comes from Gluegrant, an American project that aims to find a which genes are more important for the recovery of severely injured patients! 
Dataset information
The dataset is a medical dataset with 184 patients, distributed into 2 test groups where each group divided in 2, patients and control.
The dataset is composed of clinical values:
* Patient.id
* Age
* Sex
* Group (to what group they belong)
* Results (the outcome of the patient)
* And ~55k genes
Import Data
End of explanation
complete_data.shape
Explanation: The dimensions of the dataset are
End of explanation
complete_data.iloc[:, 0:15].head()
Explanation: Let's take a look:
End of explanation
male_patients = complete_data[complete_data.Sex == "male"]
female_patients =  complete_data[complete_data.Sex == "female"]
# Mean
male_mean_age = male_patients.Age.mean()
female_mean_age = female_patients.Age.mean()
# Median
male_median_age = male_patients.Age.median()
female_median_age = female_patients.Age.median()
# Std
male_std_age = male_patients.Age.std()
female_std_age = female_patients.Age.std()
print("The male mean age is:", male_mean_age, "The median age is:", male_median_age, \
      "and the standard dev is:", male_std_age)
print("The female mean age is:", female_mean_age, "The median age is:", female_median_age, \
      "and the standard dev is:", female_std_age)
Explanation: For those without biological background
You can consider that this dataset comes from a online shopping service like Amazon. Imagine that they were conducting an A/B test, where a small part of their website was changed, like the related items suggestions. You have 2 groups, the "control group" that is the group that is experiencing the original website (without modifications) and Group 1 that is using the website with the new suggestions.
Consider also that the genes are products or product categories where the customers buy a certain ammount of products. Your objective now is to find if there is a significant difference between the control group and Group 1.
Analysis to perform
Basic statistics on the differences between patients of differnet sexes.
Check what happened to the patients.
Check which genes are more or less expressed in the patients.
Age statistics for each of the sexes
End of explanation
display(male_patients.Age.quantile(q=[0,1/4,1/2,3/4,1]))
display(female_patients.Age.quantile(q=[0,1/4,1/2,3/4,1]))
Explanation: Quantiles
End of explanation
#Lets first remove the control patients. Those patients don't hava a result since they weren't injured.
patient_data = complete_data[~complete_data.Group.isin(["Control"])]
patient_data.Result.unique()
Explanation: There is almost no difference from the sexes! Really strange to see such close numbers...
Check out what happened to the patients
We have a column named Results that has the information of what happened to the patient. It has both happy and tragic information. Let's first check out how many results there are.
End of explanation
patient_data.Result.value_counts()
Explanation: Ok, we have 8 types of outcomes for the patients. One of them is control, ignore that, it's a problem with the dataset.
Let's check the numbers for each of these outcomes.
End of explanation
patients_death = patient_data[patient_data.Result == "09: Death"]
patients_alive = patient_data[patient_data.Result != "09: Death"]
gene_names = ["Gene1", "Gene2", "Gene3", "Gene4", "Gene5", "Gene6"]
display(patients_death[gene_names].describe())
display(patients_alive[gene_names].describe())
HTML('<style>{}</style>'.format(CSS))
Explanation: Ok, so, good news, most of our patients survived the injury! :)
Is there any gene difference that makes these differences?
Next step, is there any gene difference between the patients that survived the injury and those that didn't? 
(Optional): This question is very difficult to answer and in biostatistics we use something called survival analysis to model the patient's outcome according to a set of variables. Here we wont do that, but we will attempt to get a nice result!
Let's check if there are any genes that have very different values in the patients that survived and the ones that didn't!
End of explanation
display(Image('./profileGraph.png', width=2000, unconfined=True))
Explanation: Looking at the mean, Gene4 seems to be a good one to predict the death of the patient, since it is much higher on the dead patients that in the alive ones.
But the median (50% in the tables) say otherwise, I smell something fishy, let's see the plot of the data!
End of explanation
<END_TASK>