Exercise

Compare arrays

Out of the box, you can also use comparison operators with Numpy arrays.

Remember areas, the list of area measurements for different rooms in your house from the previous course? This time there's two Numpy arrays: my_house and your_house. They both contain the areas for the kitchen, living room, bedroom and bathroom in the same order, so you can compare them.

Instructions

100 XP

Using comparison operators, generate boolean arrays that answer the following questions:

Which areas in my_house are greater than or equal to 18?

You can also compare two Numpy arrays element-wise. Which areas in my_house are smaller than the ones in your_house?

Make sure to wrap both commands in a print() statement, so that you can inspect the output.