I am able to calculate different kinds of centralities such as degree, betweenness, closeness, and eigenvector for all the nodes in graph G. For instance, this code calculates the betweenness centrality for all of the included nodes of graph G:
import networkx as nx
# build up a graph
G = nx.Graph()
G.add_nodes_from(['A', 'B', 'C', 'D', 'E'])
G.add_edges_from([('A', 'B'), ('B','C'), ('C', 'D'), ('D', 'E')])
bw_centrality = nx.betweenness_centrality(G, normalized=True)
print (bw_centrality)
For large networks, it is very time consuming to calculate some of the centralities, such as betweenness and closeness. Therefore, I would like to calculate the centrality of only a subset of nodes, instead of calculating all of the nodes' centrality. In the example above, how can I calculate the betweenness of node A, by Networkx library in Python?