Welcome to Project Lovelace! We're still super new so there are still tons of bugs to find and improvements to make. If you have any suggestions, complaints, or any comments at all please let us know on Discourse!

El Niño intensities

You will learn about: 2D arrays, reading files.

El Niño is a naturally occurring climate oscillation event in the equatorial Pacific which returns every 2–7 years. Originally, El Niño was the name used for warmer than average sea surface temperatures in the Pacific Ocean off the coast of South America but we now know that it's responsible for a whole complex of Pacific Ocean sea-surface temperature changes and global weather events. The ocean warming and associated wet climate off South America, which brings disastrous flood and reduces fishing stocks, is just one of these events.


NINO regions.

ENSO is the “El Niño-Southern Oscillation,” the name scientists use for El Niño. The other part of the climate oscillation, the Southern Oscillation, is a see-saw shift in surface air pressure between the eastern and western halves of the Pacific. When pressure rises in the east, it falls in the west and vice versa. In the 1950's scientists realized that El Niño and the Southern Oscillation were parts of the same event.


Warm water generally appears off the coast of South America close to Christmas, and reaches its peak warmth in fall of the following year. After peaking, the waters will tend to cool slowly through the winter and spring of the next year. The effects can be felt continually around the globe, for more than a year in some places.


The Multivariate ENSO Index (MEI) is a method used to characterize the intensity of an ENSO event using a single number. It accounts for sea level pressure, zonal and meridional components of the surface wind, sea surface temperature, surface air temperature and cloudiness. The MEI is calculated for each “sliding bi-monthly season”, which are January-February, February-March, and so on for a total of 12 times per year. A warm El Niño event occurs when the MEI is at or above +0.5 for five consecutive bi-monthly periods, and a cold La Niña event occurs when the MEI is at or below -0.5 for five consecutive bi-monthly periods. The threshold is further broken down into weak (with a 0.5 to 1.0 anomaly), moderate (1.0 to 1.5), strong (1.5 to 2.0) and very strong (≥ 2.0) events.


Multivariate ENSO Index (MEI) time series.

A text file (mei_index.txt) containing the MEI index values for each two-month period from 1950 to 2017. See https://www.esrl.noaa.gov/psd/enso/mei/table.html for more details.


Input: A two-year range corresponding to a specific winter season (in the Northern Hemisphere).

Output: Two strings: 1. "El Nino", "La Nina", or "neither" depending whether the season had an El Niño or La Niña event (or neither), and if there was an event, and 2. "weak", "moderate", "strong, or "very strong" depending on the event's intensity. If there was no event, return "none" for the intensity.


Example 1

Input two-year range: "1997-98" ───────────────────────────────────────── Output ENSO classification: "el nino" Output ENSO strength: "very strong"

Example 2

Input two-year range: "1964-54" ───────────────────────────────────── Output ENSO classification: "la nina" Output ENSO strength: "weak"


 Difficulty  Timesink
 Maximum runtime 60 s  Max. memory usage 250 MiB
 Function signature enso_classification(two_year_period)

Write a function that accepts the input as function parameters and returns the correct output. Make sure to read the description above to produce the correct output in the correct format and use the correct function signature so we can run your code. A good first step is to try reproducing the example(s). Your code must not take longer than the maximum runtime to run and must not use more memory than the allowed limit.




You must be logged in to view your submissions.

  • Should be tons of really good videos on this!

Let us know what you think about this problem! Was it too hard? Difficult to understand? Also feel free to discuss the problem, ask questions, and post cool stuff on Discourse. You should be able view the discussion thread below. Feel free to post your solutions but please do your best to organize and document your code well so others can learn from it.