Send TH1,TH2 objects from cpp macro to python for conversion to np arrays


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.26/08
Built for linuxx8664gcc on Nov 10 2022, 15:48:00
From heads/latest-stable@49ba2d46
Ubuntu


Hi,

I have a ROOT macro for analysis of simulation data written in cpp. I produce a number of TH1s and TH2s, which I’d like to explore using PCA and other techniques more easily accessible to me using python. I understand I could write a pyROOT script to produce all my plots in python anyway, but before I rewrite my analysis unnecessarily, I’m wondering if there’s an easier way to export my histograms produced by my cpp macro over to python for conversion to np arrays.

Thanks,
James

Welcome to the ROOT Forum!
Did you try to search the forum? Search results for 'histograms to np arrays' - ROOT Forum
For example: Extract data from histogram as numpy array

1 Like