{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Practice Problems\n", "### Lecture 24\n", "Answer each number in a separate cell\n", "\n", "Rename the notebook with your lastName, firstInitial and the lecture number\n", " \n", " ex. Cych_B_24\n", " \n", "Turn this notebook into Canvas" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Clustering Ocean Data\n", "- The World Ocean Atlas 2013 (https://www.nodc.noaa.gov/OC5/woa13/woa13data.html) provides long term average ocean climate data across the world. Using clustering analysis on these data can help us understand more about ocean circulation and productivity. \n", "\n", "- Open the file Datasets/WOA_Surface_Data.csv as a Pandas DataFrame.\n", "- Drop all the rows that have nan values from your DataFrame\n", "- Use your Pandas DataFrame to make a **numpy** array of all the data except for the latitude and longitude columns. Look at Lecture 12 for help.\n", "- Use **KMeans** from **sklearn.cluster** to perform clustering analysis on the data points. Start by using 10 clusters. \n", "- Make a plot of the world's coastlines using **cartopy** and the **PlateCarree** projection.\n", "- Plot the ocean data on your plot using **plt.scatter( )**. Set the color to the clusters that you got from your KMeans algorithm. Use the 'nipy_spectral' colormap to easily see your clusters.\n", "- Make the markers squares and change the marker size to make the plot easier to look at.\n", "\n", "- Now make the same plot again but using 20 clusters in your **Kmeans** algorithm. \n", "\n", "- Similar work has been done by ESRI, they are calling their clusters 'Ecological Marine Units', but they did this in 3D, looking at all depths in the ocean. If you're interested, compare their clusters to yours at https://livingatlas.arcgis.com/emu/" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 4 }