Skip to content

Instantly share code, notes, and snippets.

r = []
for i in range(len(data)):
d1 = data.copy()
x = d1.pop(i)
if not x in d1:
r.append(i)
#for i in range(len(r)):
#data.pop(r(i))
return r #data
library(igraph)
a.el <- cbind(c("C"), c("a","b","c"))
a.g <- graph.edgelist(a.el)
plot(a.g)
write.graph(a.g, "nolabel.graphml", format = "graphml")
a.g <- set.vertex.attribute(a.g, "Label", value = get.vertex.attribute(a.g, "name"))
write.graph(a.g, "label.graphml", format = "graphml")
a.el <- cbind(c("C"), c("a","b","c"))
a.g <- graph.edgelist(a.el,directed=FALSE)
@ringtaro
ringtaro / 11-SNA.R
Last active December 28, 2015 18:38
入門機会学習勉強会第11章ソーシャルグラフの分析 どうやってソーシャルネットワークのグラフを取得するか
#
# Graph programming
#
library(igraph)
(a.el <- rbind(c("a", "b"), c("b","c")))
a.g <- graph.edgelist(a.el)
plot(a.g)
@ringtaro
ringtaro / ringtaro.json
Last active December 28, 2015 18:38
入門機械学習第11章Google SocialGraphテストデータ
{
"canonical_mapping": {
"http://twitter.com/ringtaro": "http://twitter.com/ringtaro"
},
"nodes": {
"http://twitter.com/ringtaro": {
"attributes": {
"exists": "1",
"bio": "Hopeful academic, data nerd, average hacker, student of conflict.",
"profile": "http://twitter.com/ringtaro",