BUG: warnings import missing for panel #8152

Closed
aidoom opened this Issue Sep 1, 2014 · 2 comments

Comments

Projects
None yet
3 participants

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
Contributor

htkm commented Sep 1, 2014

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

Contributor

jreback commented Sep 1, 2014

sure

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

use assert_produces_warning

jreback added the Bug label Sep 3, 2014

jreback added this to the 0.15.0 milestone Sep 3, 2014

jreback closed this in #8157 Sep 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment