Hi, I am trying to figure out how to get the statistics of a 2d histogram. Using: stats = (0.,1.,2.,3.,4.,5.,6.) h2.GetStats(stats) gives error message "TypeError: void TH2::GetStats(Stat_t* stats) => could not convert argument 1
If anybody could help ?
Cheers Thomas
With normal CINT or C++, this is absolutly trivial, just do double stats[7] h2.GetStats(stats)
Since you post this question in the Python thread, I assume that the problem is with the python interface. In this case, Wim will process your mail
Rene
Hi Thomas,
a tuple can not act as a placeholder like a C++ builtin array can, because it is immutable as per the python language reference. Instead, do simply:
from array import array stats = array( 'd', 7*[0.] ) # creates a mutable buffer of 7 doubles h.GetStats ( stats ) HTH, Wim
from array import array stats = array( 'd', 7*[0.] ) # creates a mutable buffer of 7 doubles h.GetStats ( stats )