Assignment Mutually Exclusive Events

Last updated: June 4th, 20202020-06-04Project preview
In [5]:
import pandas as pd
In [10]:
toy_dataset = pd.read_csv('toy_dataset.csv')
toy_dataset.head()
Out[10]:
Number City Gender Age Income Illness
0 1 Dallas Male 41 40367.0 No
1 2 Dallas Male 54 45084.0 No
2 3 Dallas Male 42 52483.0 No
3 4 Dallas Male 40 40941.0 No
4 5 Dallas Male 46 50289.0 No

We pick a person of the dataset. Consider the following event:

A={The person chosen lives in San Diego}

B={The person chosen is Male}

C={The person chosen has a income of 78898.0}

Taking events in pairs. Are mutually exclusive events?

In [ ]:
 
In [11]:
data_AB = toy_dataset[(toy_dataset["City"] == "San Diego") & (toy_dataset["Gender"]=="Male")]
data_AB.shape
Out[11]:
(2783, 6)
In [12]:
data_BC = toy_dataset[(toy_dataset["Gender"]=="Male") & (toy_dataset["Income"]==78898.0)]
data_BC.shape
Out[12]:
(0, 6)
In [13]:
data_AC = toy_dataset[(toy_dataset["City"] == "San Diego") & (toy_dataset["Income"]==78898.0)]
data_AC.shape
Out[13]:
(0, 6)
In [ ]:
 
In [ ]:
 
Notebooks AI
Notebooks AI Profile20060