Data Science Hour of Code
Activity 7: Trying Other Charts
Scenario:
- You're a data scientist working with a group of researchers from Antarctica.
- They have collected a bunch of data about penguins, but need help answering questions about it.
- Your job is to make some charts from the data and answer some of their questions.
Introduction:
There are a lot of chart types that can help us to answer different questions. Instead of making a Scatter Plot, let's try making some other chart types from the same data. Try making a Bar Chart, Box Plot, Histogram and Pie Chart. Each of these charts will show the same data from our Penguins2.csv but presents it in a different way.
| species | island | bill_depth | bill_length | flipper_length |
|---|---|---|---|---|
| Adelie | Torgersen | 18.7 | 39.1 | 181 |
| Adelie | Biscoe | 18.3 | 37.8 | 174 |
| Adelie | Dream | 18.5 | 36.8 | 193 |
| Gentoo | Biscoe | 13.2 | 46.1 | 211 |
| Chinstrap | Dream | 17.9 | 46.5 | 192 |
Instructions:
In the code editor below, we have a similar program to the last lesson, except we've removed the code black that makes our chart a Scatter Plot. Add a code block from the palette below and place it above the other blocks that reference chart.
- Use the block(s) in the palette on the left.
- Place the 'BarChart chart = frame:BarChart()' block below the 'frame:AddSelectedFactors("island")' block in the block editor.
- Run the program.
- Hint: You may need to try different Chart types to find the answers to the questions below.
- Use the chart in the canvas to answer the questions in the Activity section.
- To try other chart types: stop the program, delete the block you added to the block editor and place one of the other blocks from the palette in the same location.
- Use the new chart in the canvas to answer the questions in the Activity section.
Coding:
Activity:
Use the chart(s) you've created in the Coding section to answer a few questions.