Inversion

Report a typo

Look at a part of the "Rain in Australia" dataset a_rains:

a_rains.head()

Output:

+----+------------+------------+-----------+-----------+------------+---------------+-----------------+-------------+
|    | Date       | Location   |   MinTemp |   MaxTemp |   Rainfall | WindGustDir   |   WindGustSpeed | RainToday   |
|----+------------+------------+-----------+-----------+------------+---------------+-----------------+-------------|
|  0 | 2017-06-04 | Perth      |      12.1 |      22.2 |        0   | SSE           |              22 | No          |
|  1 | 2017-06-10 | Sydney     |      12.5 |      18.1 |       38.8 | SSE           |              50 | Yes         |
|  2 | 2017-06-06 | Canberra   |      -3.2 |      12.8 |        0.2 | SSE           |              56 | No          |
|  3 | 2017-06-09 | Melbourne  |       6.6 |      15   |        1.8 | S             |              22 | Yes         |
|  4 | 2017-06-03 | Canberra   |      -4.2 |      15.4 |        0   | W             |              19 | No          |
+----+------------+------------+-----------+-----------+------------+---------------+-----------------+-------------+

Then look at this fancy selection:

a_rains[(((a_rains.Location == 'Perth') & (a_rains.RainToday == 'No'))
       | ((a_rains.Location == 'Sydney') & (a_rains.RainToday == 'Yes')))
       & ~((a_rains.MaxTemp > 10) & (a_rains.Rainfall >= .3))]

Please, select all rows except that selection and print the result. Note that the data frame is already loaded as a_rains.

Write a program in Python 3
# your code here. The DataFrame is already loaded as a_rains.
print(...)
___

Create a free account to access the full topic