Minnesota is the “Land of 10,000 Lakes”. But did you know there are more than 10,000 lakes in the state? There are so many lakes that coming up with unique names for the lakes is very difficult! The file mn_lakes.csv (right-click, open in new tab or window) contains a list of Minnesota lakes and some basic data about them. Write a function named most_common_lake_names that takes three arguments: a filename, a minimum acreage (a), and a minimum number (n). Of all lakes of at least a acres, return an array of lake names appearing at least n times. The array should be in alphabetical order, and exclude any unnamed lakes from your analysis. Your function should use pandas operations to do the analysis, and use no loops or list comprehensions. Examples Calling your function with a minimum size of 0 and n = 1 should return all 5,072 unique lake names: In [1]: most_common_lake_names(‘mn_lakes.csv’, 0, 1) Out[1]: array([‘1st Little Gulch’, ‘2nd Little Gulch’, ‘4th Little Gulch’, …, ‘Zumbra-Sunny’, ‘Zumbro’, ‘Zumwalde’], dtype=object) Long Lake, Pelican Lake, Round Lake, and Trout lake are common (3 or more occurrences) among medium-sized (1000 acre or more) lakes: In [2]: most_common_lake_names(‘mn_lakes.csv’, 1000, 3) Out[2]: array([‘Long’, ‘Pelican’, ‘Round’, ‘Trout’], dtype=object) Bass, Cedar, and Clear lakes are among the most common (15 or more occurences) names for lakes of 50 acres or more: In [3]: most_common_lake_names(‘mn_lakes.csv’, 50, 15) Out[3]: array([‘Bass’, ‘Cedar’, ‘Clear’, ‘Crooked’, ‘Eagle’, ‘Fish’, ‘Goose’, ‘Horseshoe’, ‘Island’, ‘Johnson’, ‘Long’, ‘Loon’, ‘Mary’, ‘Moose’, ‘Mud’, ‘Perch’, ‘Pickerel’, ‘Pine’, ‘Rice’, ‘Round’, ‘Sand’, ‘Silver’, ‘Swan’, ‘Tamarack’, ‘Twin’, ‘Wolf’], dtype=object) Lake of the Woods, Leech, Mille Lacs, Rainy, Red, Superior, Vermilion, and Winnibigoshish are among Minnesota’s largest and most famous lakes. However, none of these names appear more than once among very large (30,000 acre or more) lakes: In [4]: most_common_lake_names(‘mn_lakes.csv’, 30000, 1) Out[4]: array([‘Lake of the Woods (MN)’, ‘Leech’, ‘Mille Lacs’, ‘Rainy’, ‘Red’, ‘Superior’, ‘Vermilion’, ‘Winnibigoshish’], dtype=object) In [5]: most_common_lake_names(‘mn_lakes.csv’, 30000, 2) Out[5]: array([], dtype=object)
Blog
In the highest_scoring_cities example, I concatenated the ci…
In the highest_scoring_cities example, I concatenated the city and country names to form a new column. I did this to…
A patient wants an herbal remedy to try to treat their fatty…
A patient wants an herbal remedy to try to treat their fatty liver and hepatitis. The nurse advised that some people take the following herb for those conditions, but explains that it can increase the effects of antihypertensive and immunosuppressant drugs?
A nurse cares for a patient who follows a strict vegetarian…
A nurse cares for a patient who follows a strict vegetarian diet due to cultural and religious beliefs. The prescribed medication contains gelatin, which the patient cannot consume. How should the nurse approach this situation to respect the patient’s cultural beliefs while ensuring effective treatment?
What is the primary purpose of the “five rights” of medicati…
What is the primary purpose of the “five rights” of medication administration? (Select all that apply)
A nurse is administering a new medication to a patient who d…
A nurse is administering a new medication to a patient who does not speak English. The patient appears confused and hesitant about taking the medication. How should the nurse proceed to ensure ethical and effective care?
21. When verifying the “right time” in medication administra…
21. When verifying the “right time” in medication administration, which of the following should the nurse consider?
A nurse is preparing to administer diphenhydramine 50 mg PO…
A nurse is preparing to administer diphenhydramine 50 mg PO at bedtime for allergies. Available is diphenhydramine liquid 12.5 mg/5 mL. How many mL should the nurse administer per dose? (Round the answer to the nearest whole number. Use a leading zero if it applies. Do not use a trailing zero.)
A patient is taking an herbal remedy used to treat insomnia…
A patient is taking an herbal remedy used to treat insomnia and anxiety. The nurse knows that the following remedy can treat insomnia and anxiety, but may cause severe liver damage and should not be used with CNS depressants?
A quality control nurse knows common causes of medication er…
A quality control nurse knows common causes of medication errors in the healthcare setting include: (Select all that apply)