Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
159 views
in Technique[技术] by (71.8m points)

How to produce a graph of connected data in Python?

Let's say I have a table of words, and each word has a "related words" column. In practice, this would probably be two tables with a one-to-many relationship, as each word can have more than one "related words" columns, but for simplicity, say it looks like this:

Word      | Related words
------------------------------------------------------
integer   | fraction, entire, integral ...
entire    | entirely, integer ...
fraction  | fractious, fractional, integer ...
fractious | fraction, -ous ...
-ous      | ambidextrous, advantageous, atrocious ...

And so on. I want to create a graph which shows how all of the words interlink, based on the relationships I've described in this table.

I've found an online tool which does exactly what I want, and used it to produce an example:

enter image description here

Is there a Python module which can be used to produce this sort of graph? I'm not too sure what this kind of graph is called, so I'm not sure how to research this question. I'd appreciate any pointers, or advice on how I can clarify and improve this question if needed.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

NetworkX is a Python package for the creation, manipulation of complex graph networks. It also supports interfacing with Matplotlib package for drawing the graphs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...