Generating Sankey Diagrams or Alluvial Diagrams with Python's Plotly Library | Jupyter Notebook

preview_player
Показать описание
A Sankey diagram or a Alluvial diagram is a visualization used to depict a flow from one set of values to another. This video is a Guide to Making Sankey Diagrams Using Python and Plotly.

Sankey diagrams are commonly used to display the flow of some property from one source to another. It has various arrows representing the flow of property from one source to another and the size of an arrow is proportional to the amount of property flowing from source to destination. Sankey diagrams are commonly used for purposes like population migration, website user journey, the flow of energy, the flow of other properties (oil, gas, etc.), and many more. Python is preferred nowadays for the majority of data analysis tasks and has a rich set of libraries for visualizing results of data analysis. As a part of this tutorial, we'll be explaining how to create a Sankey diagram in python using libraries holoviews and plotly. We'll also explain various ways to change the styling of the plot and improve its aesthetics. A Sankey Diagram is a visualization technique that allows us to display such flows by connecting the different entities with ribbons whose width are proportional to the flow magnitude. Alluvial diagrams are a type of flow diagram originally developed to represent changes in network structure over time. In allusion to both their visual appearance and their emphasis on flow, alluvial diagrams are named after alluvial fans that are naturally formed by the soil deposited from streaming water.

*I use affiliate links on the products that I recommend. These give me a small portion of the sales price at no cost to you. I appreciate the proceeds and they help me to improve my channel!

Equipments I use for recording the videos:

If you do have any questions with what we covered in this video then feel free to ask in the comment section below & I'll do my best to answer those.

If you enjoy these tutorials & would like to support them then the easiest way is to simply like the video & give it a thumbs up & also it's a huge help to share these videos with anyone who you think would find them useful.

Please consider clicking the SUBSCRIBE button to be notified for future videos & thank you all for watching.

You can find me on:

#SankeyDiagram #Python
Рекомендации по теме
Комментарии
Автор

Even Llama-3.2 cannot explain me this as clear as you.
Very helpful video!

SilverYun
Автор

This is the only thing that WORKED!!! Thanks so much that was so simple to understand and follow.

hemlatakohin
Автор

Great job! Very helpful and nicely explained! 🤝

ashishranshinge
Автор

Nice! I was able to do it. Thanks very much!

martindominguez
Автор

thanks! how do you get these hints when writing the code?

anarchistorca_
Автор

tks, Bhavesh, come to brasil, i will introduce you to anitta, great brazilian song

Zirecool
Автор

Another way to find unique values in a dataframe in your case would be:
unique_source_target = [ *list(links.source.unique()), *list(links.target.unique()) ]

akshayr
Автор

Sir, if i want to add different colours to edge and nodes . then what will be codes . please help. i got the three way Sankey diagram but need to add different colour

UdayKiranKommuriPHD
Автор

This was really helpful, my use case is to view a customer journey month by month, where some will extinct after x months, so I would need multiple extinction points throughout (for say a write off), when I follow this with my data I end up having all the exctinctions at the end of the sankey, how do I have a “write off” node/extinction by each month?

sgremp