Skip to content
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

BUG: warnings import missing for panel #8152

Closed
aidoom opened this issue Sep 1, 2014 · 2 comments · Fixed by #8157
Closed

BUG: warnings import missing for panel #8152

aidoom opened this issue Sep 1, 2014 · 2 comments · Fixed by #8157
Labels
Milestone

Comments

@aidoom
Copy link

aidoom commented Sep 1, 2014

It appears the warnings import is missing in panel.py

In [1]: import numpy as np

In [2]: import pandas as pd

In [3]: pd.__version__
Out[3]: '0.14.1'

In [4]: p = pd.Panel(np.random.rand(3, 3, 3))

In [5]: p.major_xs(1, copy=False)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-0b8025289379> in <module>()
----> 1 p.major_xs(1, copy=False)

/home/aido/.env/local/lib/python2.7/site-packages/pandas/core/panel.pyc in major_xs(self, key, copy)
    715         """
    716         if copy is not None:
--> 717             warnings.warn("copy keyword is deprecated, "
    718                           "default is to return a copy or a view if possible")
    719 

NameError: global name 'warnings' is not defined
@htkm
Copy link

htkm commented Sep 1, 2014

I would like to turn this into a PR if I may.

@jreback
Copy link
Contributor

jreback commented Sep 1, 2014

sure

pls add a test as well (which should fail w/o tht patch)

use assert_produces_warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants