Agroalimentary (1.5 points) =========================== From the Catalan government web we have downloaded the file :download:`agroalimentary.csv` related to Catalan agroalimentary companies. Download and study this file. We have already created a :py:ref:`DataFrame ` with this data. The following example shows the names of the columns of this :py:ref:`DataFrame ` and a subdataframe example with columns corresponding to the establishment name (``Establiment``), the region (``Comarca``), the company type (``Titularitat``) and the latitude (``Latitud``): .. literalinclude:: test-agroalimentary-1.txt :language: python :lines: 4-18 Save the following functions to file ``p4.py``. #. Write function :py:func:`agro1` that takes a :py:ref:`DataFrame `, ``df``, as that described and a string corresponding to a company type, and returns the percentage of companies of this type. (0.75 points) Examples: .. literalinclude:: test-agroalimentary-1.txt :language: python :lines: 22-25 .. note:: You have more tests in file :download:`test-agroalimentary-1.txt` .. hint:: Use selection. #. Write function :py:func:`agro2` that takes a :py:ref:`DataFrame `, ``df``, as that described, and a string with the name of a region. This function computes the most northern company (i.e. the one with the maximum latitude) in the given region, and returns a tuple with two elements: the establishment name and latitude of this company. (0.75 points) Examples: .. literalinclude:: test-agroalimentary-2.txt :language: python :lines: 22-26 .. note:: You have more tests in file :download:`test-agroalimentary-2.txt` .. hint:: Use selection, indexing and method idxmax(). .. note:: To run your functions you don't actually need to read the given data file. But you need to download it because the given testfiles read from it to create the :py:ref:`DataFrame `.