# Unit 5 - Filtering Datasets

**URL:** <https://forum.code.org/t/unit-5-filtering-datasets/36088>\
**Category:** Coding and Debugging Help\
**Created:** [March 28, 2022, 5:00pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088 "2022-03-28T17:00:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sellard](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sellard](https://forum.code.org/u/sellard)\
**Post date:** [March 28, 2022, 5:00pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/1 "2022-03-28T17:00:02Z")

</div>

Hello,  
My student is using the weather dataset and would only like the high and low temps for cities in Alaska. They imported the data set and used the get column block to get the temperature columns. We are stuck on how to filter the data specifically for Alaska. Please help.

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [March 28, 2022, 5:41pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/2 "2022-03-28T17:41:34Z")

</div>

Hello,

In accordance with the College Board’s guidelines for AP CS Principles Exam, we limit the debugging assistance we provide from March through the submission deadline for the Create Task.

From page 14 of the CB’s student handouts:

> “you may not seek assistance in writing, revising, amending, or correcting your work, including debugging the program, writing or designing functionality in the program, testing the program, or making revisions to the program, from anyone other than your collaborative partner(s). "

**Please verify this project is not part of a student’s Create Task for AP CS Principles.**

If it is, we can only verify whether there is a technical issue with the platform causing the bug. If it is not, we are happy to help locate the bug and provide guidance on fixing it!

Thank you!

---

<div class="post-metadata">

**Author:** ![sellard](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sellard](https://forum.code.org/u/sellard)\
**Post date:** [March 29, 2022, 4:25pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/3 "2022-03-29T16:25:05Z")

</div>

This is not for the Create Task. We’re behind and still trying to get through Unit 5.

---

<div class="post-metadata">

**Author:** ![madeline\_r\_burton](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/madeline_r_burton/32/5037_2.png) [@madeline\_r\_burton](https://forum.code.org/u/madeline_r_burton)\
**Post date:** [March 31, 2022, 2:25am UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/4 "2022-03-31T02:25:25Z")

</div>

Hi @sellard,

Thank you for clarifying! It sounds like this fits in our “debugging problems” category because you’re having trouble with the code of a level. In order to better understand what the issue is, it would be helpful to have some context of your problem. Would you please add a post with a few pieces of information included in order to help other teachers or our moderator team best help you? You can copy and paste the section below and replace the sections in brackets.

**Link to the project or level:** [replace with link to the curriculum or get the “Share” link to a project]  
**What I expect to happen:** [replace with a detailed description of the behavior you’re trying to create]  
**What actually happens:** [replace with a detailed description of what actually happens when the code runs including any errors or unexpected behavior]  
**What I’ve tried:** [replace with a detailed description of what you’ve already tried to do to solve the problem]

I will move this post to the debugging category so that we keep an eye out for it.

Best,  
Madeline

---

<div class="post-metadata">

**Author:** ![sellard](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sellard](https://forum.code.org/u/sellard)\
**Post date:** [March 31, 2022, 2:59pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/5 "2022-03-31T14:59:11Z")

</div>

The student wants the user to select cities in Alaska and the high and low temperatures to be returned on the screen. They imported the data set and know they need to get the high and low temp columns. I do not know how to help them with selecting only cities in Alaska.

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [March 31, 2022, 3:13pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/6 "2022-03-31T15:13:29Z")

</div>

In the filter method they should also check if state is Alasks.

if(forecastNumberList[i] == tomorrowsWeather && stateList[i] == “Alaska”)

---

<div class="post-metadata">

**Author:** ![sellard](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sellard](https://forum.code.org/u/sellard)\
**Post date:** [March 31, 2022, 5:49pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/7 "2022-03-31T17:49:25Z")

</div>

Thank you. Here’s the link to the actual project

[https://studio.code.org/projects/applab/wQS\_hFsjUZvjOe6hF83JgVgaqOPHMiXdvjX1iY07nnY](https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstudio.code.org%2Fprojects%2Fapplab%2FwQS_hFsjUZvjOe6hF83JgVgaqOPHMiXdvjX1iY07nnY&data=04%7C01%7Csellard%40gcsnc.com%7Cb1c054558dd944046e4008da133e6cfb%7C9ae2fb1fdea24c4381947624fcbbb30c%7C0%7C0%7C637843456088938339%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2BiIbZMH4%2B6MVsIjjzCdgiQEQSNocGxqYTjxLNAHf2Ms%3D&reserved=0)

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [March 31, 2022, 6:12pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/8 "2022-03-31T18:12:50Z")

</div>

The student has removed their filter method. It is needed. Go back to the previous version that was shared and simply make the change I suggested in my previous reply.

---

<div class="post-metadata">

**Author:** ![sellard](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sellard](https://forum.code.org/u/sellard)\
**Post date:** [April 4, 2022, 1:56pm UTC](https://forum.code.org/t/unit-5-filtering-datasets/36088/9 "2022-04-04T13:56:56Z")

</div>

Thank you. I’ll have them work on it this week.
