Trend detector


For up to +10XP, create a function called trend_detector() which accepts a 1-dimensional NumPy array of floating-point/decimal/double numbers (of any length), and returns one of the three string values "UPWARD", "DOWNWARD", or "STEADY". These should correspond to whether you think the numbers are showing an upward trend (like we fear global temperatures are), or a downward trend (like we hope Stephen’s weight is), or a steady-as-she-goes trend.

There’s no one right or wrong answer to this. I will judge it based on my own discretion. I’ll feed it some sequences which seem to me obvious upward trends, obvious downward trends, and obvious steady-as-she-goes trends, and see whether yours agrees with my assessment. I’ll also look at it for cleverness, elegance, and complexity.

To claim these points, email me (not data420@, but me personally) your function as a single standalone .py file no later than midnight, April 12th. The function should be called exactly trend_detector() and should function exactly as described above. Any deviations from these instructions will cost you points.