-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Adding a warning when dropping NA values for panel.to_frame #7879 #8063
Conversation
@@ -858,6 +858,9 @@ def to_frame(self, filter_observations=True): | |||
mask = com.notnull(self.values).all(axis=0) | |||
# size = mask.sum() | |||
selector = mask.ravel() | |||
if not np.all(selector): | |||
warnings.warn("NaN values found\ |
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.
You'll need to import warnings in this file too
Thanks for the PR. I added a couple comments. Let me know if they don't make sense or you need any help. |
their is another pr for this issue however I think in that one the consensus was to make an API change to make filter_observations to False instead of doing a warning which I think is a bit odd |
@TomAugspurger, I've modified the test as following
Does this match what you expected? Thanks for the reply |
@jreback So you suggest I stop working on that PR as pandas doesn't use warnings by default, Right? |
see #7970. Its not been accepted as of yet. pandas does use warnings. Its for this usecase. I think the API change is better. Really just looking for some feedback (and then impl of course). |
@Magellanea pls review that PR and post comments (here is ok). |
@jreback Concerning the API change - if I'm we're going to neglect the warnings - do you suggest that we evaluate |
@Magellanea no I meant change the default of |
@Magellanea can you rebase / address comments? |
@jreback I'm sorry for leaving this for a while, the problem was that the travis built failed, and I don't know what the reason was, I've changed the |
dupe of #7970 |
closes: #7879
I've added a warning when the
NaN
values are dropped when callingpd.Panel(dict).to_frame()
with the paramfilter_observations
trueI've supplied a test case to be used against the example provided in the issue tracker