Using the ONI data set from the previous worksheet, identify the number of months with
warm ENSO conditions (i.e. El Niño only).
In order to fulfill the required tasks, you will need to
for loop with embedded if-elif conditions (one for each stage),
In [1]:
import pandas as pd
url = "http://www.cpc.ncep.noaa.gov/data/indices/oni.ascii.txt"
# help(pd.read_fwf)
oni = pd.read_fwf(url, widths = [5, 5, 7, 7])
oni.head()
Out[1]:
In [ ]:
## Your solution goes here:
In addition, please calculate the percentage of months characterized by at least weak El Niño conditions?
In [ ]:
## Your solution goes here:
...and put the stage-specific counter variables for both warm and cold ENSO stages together in a single dictionary using meaningful and clearly distinguishable keys (e.g. 'Weak El Nino', 'Moderate El Nino', ..., 'Weak La Nina', ...). If you feel a little insecure with creating dict objects, feel free to browse back to E01-3 and let yourself inspire by the code included therein.
Oh, and remember that the stuff you created for answering the above task is still in the Jupyter Notebook's environment, so there is no need carry out the whole El Niño processing anew.
In [1]:
## Your solution goes here: