-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add to_dataframe to InferenceData #1395
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1395 +/- ##
==========================================
+ Coverage 91.63% 91.65% +0.01%
==========================================
Files 105 105
Lines 10965 11022 +57
==========================================
+ Hits 10048 10102 +54
- Misses 917 920 +3
Continue to review full report at Codecov.
|
8d57933
to
08c22d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
def __getitem__(self, key): | ||
"""Get item by key.""" | ||
if key not in self._groups_all: | ||
raise KeyError(key) | ||
return getattr(self, key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
) | ||
|
||
if not group_names: | ||
raise TypeError("No valid groups found: {}".format(groups)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logic ok?
posterior + observed_data --> df from posterior
observed_data -> TypeError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is ok, given that it fits our goals and we document it. My only question not really knowing yet how panel works is if ppc checks will be possible with it if observed_data is not in the dataframe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panel works with xarray too. My gist was just short cutting some code with data frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, cool!
Description
Add
.to_dataframe
function to InferenceData. The result is a dataframe in a "wide" format.This PR also adds
__getitem__
magic for the InferenceData.Checklist