NotImplementedError when iterating over MultiTrace object

Hi everyone.

In pymc3 it is easy to iterate over the MultiTrace object using:

for cnt, sample in enumerate(self.trace[burn_in:]):

Is there a similar way to perform that operation in pymc5 ?
I am currently getting an

/miniconda3/envs/pymc_env5/lib/python3.11/site-packages/pymc/backends/", line 366, in __iter__
raise NotImplementedError


I checked and in both pymc versions the MultiTrace objects have the same structure.

Thanks in advance!

Found an answer that is helpful here:

Keep in mind that with more recent versions of PyMC you are dealing with ArviZ InferenceData objects instead of raw MultiTrace objects. So you would be doing something like this:

for val in trace.posterior['m'].sel(chain=0)[:10]:

Details about InferenceData objects are here.