# Bar plot and proportion from data - 8:00 AM

(10 points)

Using your own random data from last week's forum question, let's use Colab to examine the `activity_level`

variable. Specifically:

- Generate a bar chart for
`activity_level`

and - Compute the proportion of folks whose activity level is
`high`

.

Note that creative burden is higher in this lab than in the last in that the Colab link above leads to a *blank* notebook. Nonetheless, you can find sample code that should help in our class presentation on Categorical Data.

## Comments

I grabbed my data like this:

I then computed my

`value_counts`

:high 39

moderate 33

none 28

We can see right away that the proportion of folks with high activity is

$39/100 = 0.39$.

Finally, my bar plot looks like so:

This is how I grabbed my data.

I then computed my 'value_counts'

moderate 36

none 32

high 32

We can see right away that the proportion of folks with high activity is $32/100= 0.32$.

Finally, my bar plot looks like:

I imported data from the last forum question, and changed my username to SGriffin as follows:

Then I generated a value count for the variable "activity level" as follows:

It gave me these outputs:

moderate 36

high 34

none 30

I then used that data to plot a bar chart with the following code:

Then I analyzed the proportion of people that were listed as "high activity" with the following code:

That told me my proportion of those with a high activity level is .34 $(34/100)$

Finally, my bar plot looks like this:

Using last weeks table-

Using value_counts; we can see how many people have a high activity level

moderate 42

none 34

high 24

Name: activity_level, dtype: int64

Our proportion with high activity is

$34/100=0.34$

To make a bar plot of this use

I grabbed my data like this:

I then computed my 'value_counts':

high 39

none 35

moderate 26

Name: activity_level, dtype: int64

Our proportion with high activity is:

39/100=0.39

To make a bar plot of this use:

I received my data like so:

I then computed my 'value_counts':

moderate 37

high 34

none 29

We can see from the collected data that the proportion of people with high activity is:

$ 34/100 = 0.34 $

Finally, my bar plot looks like so:

Grabbed my data:

My value counts

none 43

high 30

moderate 27

The proportion of people with high activity level is:

$30/100 = 0.30$.

Finally, the bar plot looks like this:

I used the same data set as last week

Used value counts to identify the numbers of people with different activity levels

Then I made a bar chart using the data

The proportion with high activity is 27/100=.27

I grabbed my data like this:

I then computed my value counts:

High 39

moderate 34

none 27

We can see that the proportion of folks with high activity

39/100 = 0.39

finally, my bar plot looks like:

I grabbed my data like this:

I then computed my value_counts:

none 33

moderate 33

high 34

We can see right away that the proportion of folks with high activity is

34/100=0.34

Finally, my bar plot looks like so:

value_counts.plot.bar(figsize=(12,7), rot = 0);

I grabbed my data like this:

I then computed my value_counts:

none 35

high 34

moderate 31

We can see right away that the proportion of folks with high activity is

$34/100 = 0.34$

Finally my bar chart looks like so:

This is how I collected my data

I then computed my value_counts

none 34

high 34

moderate 32

We can see right away that the proportion of folks with high activity is 34/100= 0.34.

Finally, my bar plot looks like this:

I grabbed my data like this:

I then computed my value_counts:

high 39

moderate 32

none 29

We can see right away that the proportion of folks with high activity is

39/100 = 0.39

Finally, my bar plot looks like so:

I got my data like this

Then i computed my value_counts:

none 38

moderate 31

high. 31

The proportion of people with high activity is

.31

I found this using the

Lastly, my bar chart looks like:

This is how I grabbed my data:

I then computed my value count:

moderate 34

none 29

We can see right away that the proportion of folks with high activity is:

37/100 = .37

Finally, my bar plot looks like this:

I grabbed my data like this:

I then computed my value_counts:

none 39

moderate 31

high 30

Finally, my bar plot looks like so: