Created
August 4, 2012 10:34
-
-
Save millionsmile/3256617 to your computer and use it in GitHub Desktop.
Histogram in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pythonでヒストグラム | |
# [データ]https://github.com/maksim2042/SNABook/tree/master/chapter1/egypt_retweets.net | |
# データファイルはpythonを実行しているフォルダーと同じ階層に置く | |
e=net.read_pajek("egypt_retweets.net") | |
len(e) # 25178 | |
len(net.connected_component_subgraphs(e)) # 3122 | |
import matplotlib.pyplot as plot | |
x=[len(c) for c in net.connected_component_subgraphs(e)] | |
plot.hist(x) | |
show() | |
# plot.hist(x, range(1,10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment