Open drbenvincent opened 1 year ago
This is expected behavior with xarray.Dataset
(data is in tidy / long -format).
If you want data in wide format, use the to_dataframe from InferenceData object.
idata2.to_dataframe(groups="prior")[["x", "y"]]
We should add var_names to the functionality and also add a function to support xarray Datasets.
Describe the bug When sampling from a model, and trying to extract the samples into a dataframe, I'm finding that it will crash the kernel.
To Reproduce
When![Screenshot 2023-07-02 at 09 49 26](https://github.com/arviz-devs/arviz/assets/6765047/0ccd11ab-035d-45c0-8d14-8cd331da7bb7)
N=10_000
, this works on my machine and gives the following result.NOTE: that the dataframe has 100 million rows
But much above this leads to a kernel crash. In my use case I am using
N=100_000
.This is related to the strategy of setting the shape of the variables to
N
then drawing 1 sample. For example, if we change the shape to the default 1, and instead ask forN
samples, then it works fine. This does work as expected:Expected behavior This may well be an edge case, but the expected behaviour would be to get a dataframe with
N
rows, even with the originalmodel1
strategy.Additional context Arviz version: 0.15.1