Peaks (2 points) ================ Data concerning the world highest mountains are stored in file :download:`peaks.csv`. Download it and examine its contents. We have already read this file obtaining the corresponding :py:ref:`DataFrame `, ``dfpeaks``. The following example shows the names of all the columns of it and a subdataframe example: .. literalinclude:: test-example.txt :language: python :lines: 4-13 Save the following functions into file ``peaks.py`` and design it by using the `pandas library `__. #. Write function :py:func:`max_ascents` that takes a :py:ref:`DataFrame `, ``dfpeaks``, as that described, the name of a country (:py:class:`str`) and a year (:py:class:`int`). This function considers only the subset of mountains that belong to the given country and such that its first ascent has been in the given year or in a subsequent year, and returns a :class:`tuple` with two items: the name of the mountain with the maximum number of ascents (:py:class:`str`) and this maximum number of ascents (:py:class:`int`) (1 point). Examples: .. literalinclude:: test-max_ascents.txt :language: python :lines: 5-10 .. note:: You have more tests in file :download:`test-max_ascents.txt` .. hint:: Use indexing, selection and methods ``max`` and ``idxmax``. #. Write function :py:func:`mount_range` that takes a :py:ref:`DataFrame `, ``dfpeaks``, as that described, and returns another :py:ref:`DataFrame ` resulting from grouping by mountain range (column ``'Range'``). The index of this DataFrame is all the mountain ranges in the given DataFrame and it has three columns with, respectively, the maximum mountain height and the total number of ascents and failed attempts for each mountain range (1 point). Example: .. literalinclude:: test-range.txt :language: python :lines: 5-16 .. note:: You have more tests in file :download:`test-range.txt` .. hint:: Use methods ``groupby`` and ``agg``. .. note:: To run these functions you don't actually need to read the given data file. But you need to download and save it into your working folder because the given testfiles read from it to create the DataFrame.