From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms

Unlock this course with a free trial

Join today to access over 25,400 courses taught by industry experts.

Grouping data with hierarchical clustering

Grouping data with hierarchical clustering

- [Instructor] When we run algorithms, we're looking for outcomes like how data points group together. One way we can group data is by using clustering algorithms. Hierarchical clustering algorithms pair up the closest data points or existing clusters with each iteration to create essentially a matrix of distance calculations. K-Means clustering algorithms, group data to K clusters by minimizing the total distance between each data point and their assigned centroid. Let's first explore hierarchical clustering and code spaces and then translate the Python code into Excel Python code cells. In addition to the Pandas library, we're also using the linkage function from the cluster hierarchy part of the SciPy library. We already have code to create a data frame that stores the average temperature for several cities in California. We'll run this code and then we'll start modeling hierarchical clustering using this data. In order for this model to work, we need to create a list of tuples for…

Contents