Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ネットワークxiでグラフを使用すると、グラフGからノードnの次の属性を呼び出すことができます。
G.node[n] {'type': 'a', 'pos': [0.22, 0.33]}
次のようなさまざまな属性(キー)にアクセスできます
G.node[n]['pos']
しかし、「pos」の最初または2番目の要素にのみアクセスするにはどうすればよいかわかりません。すなわち
0.22
何か案は?
これにより、最初の要素が得られます。
G.node[n]['pos'][0]