Convert TH2D to numpy array

Hi,

[quote=“dguest”]Thanks, although it’s hard to know what to do with the result, for example:[/quote]in C++, a pointer representing an array has no further info, so the default is to set the size of the returned array to MAXINT. However, in your own example above, you already have the actual number of bins (GetNbinsX(), GetNbinsY()), and hence the dimensions.

More details (and possible pitfalls) here: [url]Problem reading from buffer with numpy

HTH,
Wim