0
我该如何去寻找以最有效的方式获得“男性”或“投票”的概率?使用熊猫的联合概率DataFrame
import pandas as pd
from pandas import DataFrame
df = DataFrame({"Voted for": {"Males": .22, "Females": .18},
"Voted against" : {"Males": .33, "Females": .27},
})
给出:
In [219]: df
Out[219]:
Voted against Voted for
Females 0.27 0.18
Males 0.33 0.22