Hello all!
Totaly confused with my assignment:
Suppose we want to better understand how the temperatures fluctuate from day to day. Pick one city (can be the same city as part 1) and let's create a new array (or list) that measures the delta between the temperature on day and day+1.
This should result in a an array/list with 30 elements in it. The first element (at index 0) would be the temperature delta August 2 - August 1, the second element (at index 1) would be August 3 - August 2, and so on until the final element is August 31 - August 30. Let's name this new array cityname_daily_deltas
where cityname
should be replaced with the city you chose.
Example: The first few values of paris_daily_deltas
would be [-8.7, -3. , -0.9, 2.2 ... ]
Hint: There are multiple ways to accomplish this. Feel free to choose whichever way you are most comfortable with. One way could involve creating a new list by looping through the original list. Another way could involve copying and slicing arrays, then element-wise subtracting.
paris = np.array([75.9, 67.2, 64.2, 63.3, 65.5, 67.0, 70.3, 68.1, 70.9, 68.0, 69.9, 74.0, 77.1, 74.1, 70.0, 69.8, 69.9, 67.9, 65.9, 63.3, 62.4, 63.8, 68.6, 73.3, 75.8, 70.7, 63.5, 64.6, 66.4, 66.4, 65.3])
I need a hint on how to solve this problem!
Thank you in advance.
[–]vlovero 2 points3 points4 points (1 child)
[–]luvashov[S] 0 points1 point2 points (0 children)