I have the following dataset from the following commands

```
df.ab.value_counts()

Out[154]:

0    31196
1    18804
dtype: int64

```

I want to find the fraction of 1 out of total counts. So basically 18804/50000

I do the following: 

```
(df.ab.value_counts()[1])/(df.ab.count())

Out[146]:

0

```

As you see it gives me zero while it should be 0.3768 (18804/50000)

Any idea why?

Edit II: 

Any idea how to plot the bar graph of these two values 0 and 1 and their counts?