<p dir="auto">Hello,<br>
I tried to use the clip function on a basic Panel but it seems that the axis management is not working as expected. I believe this is an update to issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="43344682" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/8344" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/8344/hovercard" href="https://github.com/pandas-dev/pandas/issues/8344">#8344</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
import pandas as pd

data = np.random.randn(3, 4, 5)
panel = pd.Panel(data)
panel.clip(0, 1)"><pre class="notranslate"><code class="notranslate">import numpy as np
import pandas as pd

data = np.random.randn(3, 4, 5)
panel = pd.Panel(data)
panel.clip(0, 1)
</code></pre></div>
<p dir="auto">If I run the script with pandas 0.16.2 on python 2.7.10 and 3.4.3, I'm getting the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=".../pandas/core/generic.pyc in clip(self, lower, upper, out, axis)
   3052         result = self
   3053         if lower is not None:
-&gt; 3054             result = result.clip_lower(lower, axis)
   3055         if upper is not None:
   3056             result = result.clip_upper(upper, axis)

.../pandas/core/generic.pyc in clip_lower(self, threshold, axis)
   3103             raise ValueError(&quot;Cannot use an NA value as a clip threshold&quot;)
   3104 
-&gt; 3105         subset = self.ge(threshold, axis=axis) | isnull(self)
   3106         return self.where(subset, threshold, axis=axis)
   3107 

TypeError: f() got an unexpected keyword argument 'axis'"><pre class="notranslate"><code class="notranslate">.../pandas/core/generic.pyc in clip(self, lower, upper, out, axis)
   3052         result = self
   3053         if lower is not None:
-&gt; 3054             result = result.clip_lower(lower, axis)
   3055         if upper is not None:
   3056             result = result.clip_upper(upper, axis)

.../pandas/core/generic.pyc in clip_lower(self, threshold, axis)
   3103             raise ValueError("Cannot use an NA value as a clip threshold")
   3104 
-&gt; 3105         subset = self.ge(threshold, axis=axis) | isnull(self)
   3106         return self.where(subset, threshold, axis=axis)
   3107 

TypeError: f() got an unexpected keyword argument 'axis'
</code></pre></div>
<p dir="auto"><strong>Thanks a lot for all your efforts!</strong></p>
<p dir="auto">Let's take the following example:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="d = {'Item1' : pandas.DataFrame(numpy.random.randn(4, 3)),
     'Item2' : pandas.DataFrame(numpy.random.randn(4, 2))}

p = pandas.Panel(d)
p.clip(0,1)"><pre class="notranslate"><span class="pl-s1">d</span> <span class="pl-c1">=</span> {<span class="pl-s">'Item1'</span> : <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">numpy</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">4</span>, <span class="pl-c1">3</span>)),
     <span class="pl-s">'Item2'</span> : <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">numpy</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">4</span>, <span class="pl-c1">2</span>))}

<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-v">Panel</span>(<span class="pl-s1">d</span>)
<span class="pl-s1">p</span>.<span class="pl-en">clip</span>(<span class="pl-c1">0</span>,<span class="pl-c1">1</span>)</pre></div>
<p dir="auto">If I run the script with pandas 0.14.1 on both python 2.7.8 and 3.4.1 I'm getting the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;Untitled.py&quot;, line 11, in &lt;module&gt;
    p.clip(0,1)
  File &quot;/usr/local/lib/python2.7/site-packages/pandas/core/generic.py&quot;, line 2684, in clip
    result = result.clip_lower(lower)
  File &quot;/usr/local/lib/python2.7/site-packages/pandas/core/generic.py&quot;, line 2722, in clip_lower
    return self.where((self &gt;= threshold) | isnull(self), threshold)
  File &quot;/usr/local/lib/python2.7/site-packages/pandas/core/ops.py&quot;, line 934, in f
    self._constructor.__name__)
ValueError: Simple arithmetic with Panel can only be done with scalar values"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "Untitled.py", line 11, in &lt;module&gt;
    p.clip(0,1)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/generic.py", line 2684, in clip
    result = result.clip_lower(lower)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/generic.py", line 2722, in clip_lower
    return self.where((self &gt;= threshold) | isnull(self), threshold)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 934, in f
    self._constructor.__name__)
ValueError: Simple arithmetic with Panel can only be done with scalar values
</code></pre></div>
<p dir="auto">Digging a little bit deeper showed that the following line (the | operator to be precise) raises the error:<br>
<a href="https://github.com/pydata/pandas/blob/1d65bc89d64c71f8d36f3ca92dd57db2efad7fdb/pandas/core/generic.py#L2796">https://github.com/pydata/pandas/blob/1d65bc89d64c71f8d36f3ca92dd57db2efad7fdb/pandas/core/generic.py#L2796</a></p>