You are on page 1of 15

In this project we’re going to:

● learn about creating ​data frames


● use ​charts​ to show data
● use simple statistics like ​min​, ​max​ and ​mean

First make sure you’re logged into ​Google​:

● https://accounts.google.com/ServiceLogin

1
Use a ruler to measure the length of fingers on your left hand.

Make sure you start with your thumb first.

finger length in cm
1
2
3
4
5

2
Click on this link to open a notebook:

● https://tinyurl.com/y4yuhvr3

You should see a page that looks like this:

3
We need our own copy of the notebook.

Use the ​File​ menu to ​Save a copy in Drive​:

You will be taken to your own copy of the notebook.

4
We’re going to be using a coding language called ​python​.

But ​python​ needs help from a library called ​pandas​.

Run the code that imports ​pandas​ by clicking the play button:

5
In the code you can see a ​list​ of finger lengths.

Change the ​list​ so it has your own finger measurements.

Run the cell to see your finger measurements printed out.

6
We now need to turn that list into a ​dataframe​.

A ​dataframe​ can have lots of rows and columns. A ​dataframe​ can also
have names for each column or row.

Run the next cell which turns our list ​left_fingers​ into a ​dataframe
called ​left_hand_df​.

You can see the column is given a name ‘​length​’.

Printing the ​dataframe​ looks nicer than printing the ​list​ we saw earlier.

7
Let’s draw a picture showing the lengths of our fingers.

The next cell plots the data inside the ​dataframe​.

You can see we’re choosing to draw a bar chart.

We’re also setting the title and size of the chart.

Your chart will look different because your hand is different to mine!

8
Let’s now try our right hand.

Use a ruler to measure the length of fingers on your left hand. Make sure
you start with your thumb first.

finger length in cm
1
2
3
4
5

9
Further down the notebook is a cell where you can put your right hand
finger lengths into a list called ​right_fingers​.

Just like before, turn the ​list​ into a ​dataframe​ called ​right_hand_df​.

Check the ​dataframe​ contains the correct numbers by printing it out.

10
Draw a bar chart for your right hand.

Do the charts for your left and right hands look different?

11
Let’s compare our left and right hands.

The next few notebook cells show how you can find out the ​longest​ and
shortest​ finger lengths for each hand.

You can also see how to find out the mean ​average​ finger length too.

See if you can fill in the table.

length left hand right hand


maximum
mean
minimum

You’ll need to change the code in the notebook to complete the table.

Using the numbers in the table, can you decide which hand is ​bigger​?

Think about what ​bigger​ means.

There isn’t one correct answer to this question.

12
It would be easier to see information about both hands together.

Let’s join the two ​dataframes​ together.

The new ​dataframe​ is called ​both_hands_df​.

You can see that we’ve changed the column names to be ​‘left’​ and
‘​right​’.

13
Let’s draw a chart showing both hands.

This is easy because the new ​dataframe​ has data about both hands.

Are your hands exactly symmetrical?

Change the code so your chart has your name in the title.

14

You might also like