I have a graph and want to calculate its indegree and outdegree centralization. I tried to do this by using python networkx, but there I can only find a method to calculate indegree and outdegree centrality for each node. Is there a way to calculate in- and outdegree centralization of a graph in networkx?
This answer has been taken from a Google Groups on the issue (in the context of using R) that helps clarify the maths taken along with the above answer:

Freeman's approach measures "the average difference in centrality 
  between the most central actor and all others". 
This 'centralization' is exactly captured in the mathematical  formula
sum(max(x)-x)/(length(x)-1) 
x refers to any centrality measure! That is, if you want to calculate 
  the degree centralization of a network, x has simply to capture the 
  vector of all degree values in the network. To compare various 
  centralization measures, it is best to use standardized centrality 
  measures, i.e. the centrality values should always be smaller than 1 
  (best position in any possible network) and greater than 0 (worst 
  position)... if you do so, the centralization will also be in the 
  range of [0,1]. 
For degree, e.g., the 'best position' is to have an edge to all other 
  nodes (i.e. incident edges = number of nodes minus 1) and the 'worst 
  position' is to have no incident edge at all.
calculate indegree centralization of graph with python networkx