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

Sdílet
Vložit
  • čas přidán 17. 03. 2022
  • 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.
    ▶ Link to the code : github.com/bhattbhavesh91/san...
    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.
    ▶ Sponsor me on GitHub : github.com/sponsors/bhattbhav...
    ▶ Join this channel to get access to perks: bit.ly/BhaveshBhattJoin
    ▶ Join the Telegram channel for regular updates: t.me/bhattbhavesh91
    ▶ If you like my work, you can buy me a coffee : bit.ly/BuyBhaveshCoffee
    *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!
    ▶ Best Book for Python : amzn.to/3qYThqu
    ▶ Best Book for Statistics : amzn.to/3vzvHEn
    ▶ Best Book for BERT: amzn.to/3lpX0fz
    ▶ Best Book for Machine Learning : amzn.to/2P6aZuT
    ▶ Best Book for Deep Learning : amzn.to/30UMTGl
    ▶ Best Intro Book for MLOps : amzn.to/3AoPZmM
    Equipments I use for recording the videos:
    ▶ 1st Laptop I use : amzn.to/3AqI8Fp
    ▶ 2nd Laptop I use : amzn.to/3KAiYsB
    ▶ Microphone : amzn.to/3qUPxtz
    ▶ Camera : amzn.to/3rKQsM2
    ▶ Mobile Phone : amzn.to/3nRHP1f
    ▶ Ring Light : amzn.to/33LedM5
    ▶ RGB Light : amzn.to/3KzLgmS
    ▶ Bag I use : amzn.to/3AsM3RZ
    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:
    ▶ Blog - bhattbhavesh91.github.io
    ▶ Twitter - / _bhaveshbhatt
    ▶ GitHub - github.com/bhattbhavesh91
    ▶ Medium - / bhattbhavesh91
    ▶ About.me - about.me/bhattbhavesh91
    ▶ Linktree - linktr.ee/bhattbhavesh91
    ▶ DEV Community - dev.to/bhattbhavesh91
    ▶ Telegram - t.me/bhattbhavesh91
    #SankeyDiagram #Python

Komentáře • 22

  • @hemlatakohin2813
    @hemlatakohin2813 Před rokem +5

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

  • @rea1Rondesantis
    @rea1Rondesantis Před rokem +1

    Very helpful! Love your tutorial!

  • @MrWolfy20
    @MrWolfy20 Před rokem

    This was fantastic, great work

  • @martindominguez1627
    @martindominguez1627 Před rokem

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

  • @Hassibayub
    @Hassibayub Před rokem

    Perfectly explained!

  • @maximilianob.t.9462
    @maximilianob.t.9462 Před rokem

    This was great, thank you!

  • @daniel24682
    @daniel24682 Před rokem

    really helped! thanks 👍

  • @ashishranshinge
    @ashishranshinge Před rokem

    Great job! Very helpful and nicely explained! 🤝

  • @UdayKiranKommuriPHD
    @UdayKiranKommuriPHD Před 2 lety

    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

  • @LearningToLiveNow
    @LearningToLiveNow Před rokem

    Excellent!!!

  • @anarchistorca_1312
    @anarchistorca_1312 Před rokem +1

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

  • @sgremp1
    @sgremp1 Před rokem

    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?

  • @elhamrahmani2405
    @elhamrahmani2405 Před 5 měsíci

    Was great, thanks!

  • @riaanduplooy5314
    @riaanduplooy5314 Před 8 měsíci

    Great example!

  • @akshayr7333
    @akshayr7333 Před rokem

    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()) ]

  • @user-bu4td8ih8v
    @user-bu4td8ih8v Před 5 měsíci

    Thank you

  • @Zirecool
    @Zirecool Před 10 měsíci

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