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

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Visualizing hierarchical clustering with dendrograms

Visualizing hierarchical clustering with dendrograms

- [Instructor] One of the benefits of using Python visuals is that it enables us to tap into visuals that we wouldn't otherwise be able to natively create in Excel. Dendrograms are a great example of these visuals. This order bar chart gives us an idea of what we can expect in our next visualization that will create in Python. We'd expect Burbank and Bakersfield, the hotter cities in this data, to be grouped together. While we expect cooler cities like San Francisco, Santa Barbara, and Sacramento would be grouped together at the other end. We already calculated the distances as output for one and two dimensional data in the previous chapter for clustering algorithms. Let's then call the dendrogram function on these distance objects. Within the dendrogram function, we call our one dimensional distance object first. To display the plot, we add plt.show for the last line of Python code in our cell and run it all together. Dendrograms are visuals that look a lot like trees with paired…

Contents