内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用
使用NetworkX和新建库来进行社交网络分析查询
G2 = nx.MultiDiGraph()
G2.add_node( "UserA", { "type" :"Cat" } )
G2.add_node( "UserB", { "type" :"Dog" } )
G2.add_node( "UserC", { "type" :"Mouse" } )
G2.add_node( "Likes", { "type" :"Feeling" } )
G2.add_node( "Hates", { "type" :"Feeling" } )
G2.add_edge( "UserA", 'Hates' , statementid="1" )
G2.add_edge( "Hates", 'UserB' , statementid="1" )
G2.add_edge( "UserC", 'Hates' , statementid="2" )
G2.add_edge( "Hates", 'UserA' , statementid="2" )
G2.add_edge( "UserB", 'Hates' , statementid="3" )
G2.add_edge( "Hates", 'UserA' , statementid="3" )
G2.add_edge( "UserC", 'Likes' , statementid="3" )
G2.add_edge( "Likes", 'UserB' , statementid="3" )
如下
for node,data in G2.nodes_iter(data=True):
if ( data['type'] == "Cat" ):
# get all edges out from these nodes
#then recursively follow using a filter for a specific statement_id
#or get all edges with a specific statement id
# look for with a node attribute of "cat"
有没有更好的方法来查询?或者是创建自定义迭代来创建子图的最佳做法?
编写一行代码来生成具有特定属性的节点列表或生成器
import networkx as nx G = nx.Graph() G.add_node(1, label='one') G.add_node(2, label='fish') G.add_node(3, label='two') G.add_node(4, label='fish') # method 1 fish = (n for n in G if G.node[n]['label']=='fish') # method 2 fish2 = (n for n,d in G.nodes(data=True) if d['label']=='fish') print(list(fish)) print(list(fish2)) G.add_edge(1,2,color='red') G.add_edge(2,3,color='blue') red = ((u,v) for u,v,d in G.edges(data=True) if d['color']=='red') print(list(red))
可以对这些属性创建一个“反向字典”,
labels = {} for n, d in G.nodes(data=True): l = d['label'] labels[l] = labels.get(l, []) labels[l].append(n) print labels
目前呼叫中心只有API文档,需要用户自己开发。如果用户需要saas系统的呼叫中心可以使用智能外呼机器人:https://cloud.tencent.com/product/ccsr
你有没有调整观众端表现,即通过对 LivePushConfig 中的homeOrientation设置项进行配置,它控制的是观众端看到的视频宽高比是16:9还是6:19,调整后的结果可以用播放器查看以确认是否符合预期。
控制台使用的是新的接口,批量创建子网,https://cloud.tencent.com/document/product/215/31960,可以指定路由表。terraform开发的时候是基于api2.0开发的,还没有这个接口,因此暂时无法使用