I have a dataframe of stock tickers which have a few features. Below is the dataframe:


Currently I am using networkx and pyvis to create network graphs. At the moment, I'm only able to use either one of the features GICS_SECTOR_NAME or GICS_INDUSTRY_GROUP_NAME, to create the network graphs. Here is the current output: Existing Output (I've zoomed in on one of the Industry group nodes in the image above, to make it legible. All the industry groups are visible if you zoom out)

I want to arrange the BBTICKERS in this dataframe in multi layered nodes like:

Expected output: Expected Output

Can someone help me figure out how I can do this? or point me to some resources which can help me move in the right direction?

Thank you so much! Cheers.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.