# Python NumPy For Your Grandma - 2.7 Challenge: High School Reunion

Contents

## Intro To Challenges

In this video, we’re going to do the first of many challenges. I tried to make these challenges align with what we’ve already learned, but in some cases the solution requires a new function or trick that we haven’t discussed. That’s on purpose because in the real world the problems you come across aren’t limited to things you’ve already seen, so part of being a good data scientist is having the ability to search for a solution online, and to read and interpret documentation. So I’m going to encourage you to do all those things in your attempt to solve these problems.

## Setup

With your high school reunion fast approaching, you decide to get in shape and lose some weight. You record your weight every day for five weeks starting on a Monday. Given these daily weights, build an array with your average weight per weekend.

So, here’s the setup code. It just produces an array with 35 values, where this first value represents your first recorded weight, 185 lbs, and that’s on a Monday.

``````import numpy as np

dailywts = 185 - np.arange(5*7)/5
print(dailywts)
## [185.  184.8 184.6 184.4 184.2 184.  183.8 183.6 183.4 183.2 183.  182.8
##  182.6 182.4 182.2 182.  181.8 181.6 181.4 181.2 181.  180.8 180.6 180.4
##  180.2 180.  179.8 179.6 179.4 179.2 179.  178.8 178.6 178.4 178.2]
``````

Your goal is to build a 5-element array where each value gives your average weight on the corresponding weekend.

## Solution

``````(dailywts[5::7] + dailywts[6::7])/2
## array([183.9, 182.5, 181.1, 179.7, 178.3])
``````