<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
import random

str_values = ['a', 'b']

data = [[random.choice(str_values), random.choice(str_values),
         random.randint(0, 10), random.randint(1, 20), random.random()] for _ in range(100)]

df = pd.DataFrame(data, columns=['s0', 's1',  'int0', 'int1', 'float0'])

group_index_true = df.groupby(['s0', 's1'], as_index=True)
print(group_index_true.mean())
print(group_index_true.std())

group_index_false = df.groupby(['s0', 's1'], as_index=False)
print(group_index_false.mean())
print(group_index_false.std())
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">random</span>

<span class="pl-s1">str_values</span> <span class="pl-c1">=</span> [<span class="pl-s">'a'</span>, <span class="pl-s">'b'</span>]

<span class="pl-s1">data</span> <span class="pl-c1">=</span> [[<span class="pl-s1">random</span>.<span class="pl-en">choice</span>(<span class="pl-s1">str_values</span>), <span class="pl-s1">random</span>.<span class="pl-en">choice</span>(<span class="pl-s1">str_values</span>),
         <span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">0</span>, <span class="pl-c1">10</span>), <span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">1</span>, <span class="pl-c1">20</span>), <span class="pl-s1">random</span>.<span class="pl-en">random</span>()] <span class="pl-k">for</span> <span class="pl-s1">_</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">100</span>)]

<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span>, <span class="pl-s1">columns</span><span class="pl-c1">=</span>[<span class="pl-s">'s0'</span>, <span class="pl-s">'s1'</span>,  <span class="pl-s">'int0'</span>, <span class="pl-s">'int1'</span>, <span class="pl-s">'float0'</span>])

<span class="pl-s1">group_index_true</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>([<span class="pl-s">'s0'</span>, <span class="pl-s">'s1'</span>], <span class="pl-s1">as_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-en">print</span>(<span class="pl-s1">group_index_true</span>.<span class="pl-en">mean</span>())
<span class="pl-en">print</span>(<span class="pl-s1">group_index_true</span>.<span class="pl-en">std</span>())

<span class="pl-s1">group_index_false</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>([<span class="pl-s">'s0'</span>, <span class="pl-s">'s1'</span>], <span class="pl-s1">as_index</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
<span class="pl-en">print</span>(<span class="pl-s1">group_index_false</span>.<span class="pl-en">mean</span>())
<span class="pl-en">print</span>(<span class="pl-s1">group_index_false</span>.<span class="pl-en">std</span>())</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">The last line gives an <code class="notranslate">AtributeError</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;pandasbug.py&quot;, line 17, in &lt;module&gt;
    print(group_index_false.std())
  File &quot;/home/user/pyenv/lib/python3.5/site-packages/pandas/core/groupby.py&quot;, line 1083, in std
    return np.sqrt(self.var(ddof=ddof, **kwargs))
AttributeError: 'str' object has no attribute 'sqrt'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "pandasbug.py", line 17, in &lt;module&gt;
    print(group_index_false.std())
  File "/home/user/pyenv/lib/python3.5/site-packages/pandas/core/groupby.py", line 1083, in std
    return np.sqrt(self.var(ddof=ddof, **kwargs))
AttributeError: 'str' object has no attribute 'sqrt'
</code></pre></div>
<p dir="auto">If the <code class="notranslate">as_index</code> is set to <code class="notranslate">False</code> in the <code class="notranslate">groupby</code> operation, the sqrt is applied to all the columns, even to the columns that where used to group,  which raises an error when at least one column is not numeric.</p>
<p dir="auto">This error is related to issues: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="110987537" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11300" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/11300/hovercard" href="https://github.com/pandas-dev/pandas/pull/11300">#11300</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="186382820" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14547" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/14547/hovercard" href="https://github.com/pandas-dev/pandas/issues/14547">#14547</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114766613" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11507" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/11507/hovercard" href="https://github.com/pandas-dev/pandas/pull/11507">#11507</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="88354046" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/10355" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/10355/hovercard" href="https://github.com/pandas-dev/pandas/issues/10355">#10355</a></p>
<h4 dir="auto">Expected Output</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="           int0       int1    float0
s0 s1                               
a  a   4.440000  11.080000  0.498588
   b   4.352941  11.941176  0.557430
b  a   5.619048  10.190476  0.442739
   b   4.864865  11.648649  0.522814

           int0      int1    float0
s0 s1                              
a  a   3.176476  4.864155  0.274068
   b   3.936070  4.955686  0.260301
b  a   3.138092  6.384505  0.341268
   b   3.172470  6.051704  0.260665

  s0 s1      int0       int1    float0
0  a  a  4.440000  11.080000  0.498588
1  a  b  4.352941  11.941176  0.557430
2  b  a  5.619048  10.190476  0.442739
3  b  b  4.864865  11.648649  0.522814

  s0 s1      int0       int1    float0               
0  a  a   3.176476  4.864155  0.274068
1  a  b   3.936070  4.955686  0.260301
2  b  a   3.138092  6.384505  0.341268
3  b  b   3.172470  6.051704  0.260665"><pre class="notranslate"><code class="notranslate">           int0       int1    float0
s0 s1                               
a  a   4.440000  11.080000  0.498588
   b   4.352941  11.941176  0.557430
b  a   5.619048  10.190476  0.442739
   b   4.864865  11.648649  0.522814

           int0      int1    float0
s0 s1                              
a  a   3.176476  4.864155  0.274068
   b   3.936070  4.955686  0.260301
b  a   3.138092  6.384505  0.341268
   b   3.172470  6.051704  0.260665

  s0 s1      int0       int1    float0
0  a  a  4.440000  11.080000  0.498588
1  a  b  4.352941  11.941176  0.557430
2  b  a  5.619048  10.190476  0.442739
3  b  b  4.864865  11.648649  0.522814

  s0 s1      int0       int1    float0               
0  a  a   3.176476  4.864155  0.274068
1  a  b   3.936070  4.955686  0.260301
2  b  a   3.138092  6.384505  0.341268
3  b  b   3.172470  6.051704  0.260665
</code></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-81-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: es_ES.UTF-8
LOCALE: es_ES.UTF-8
<p dir="auto">pandas: 0.20.2<br>
pytest: None<br>
pip: 9.0.1<br>
setuptools: 36.0.1<br>
Cython: 0.25.1<br>
numpy: 1.13.0<br>
scipy: 0.18.1<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.0<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.0<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 1.5.3<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: 0.7.3<br>
lxml: None<br>
bs4: 4.4.1<br>
html5lib: 0.999<br>
sqlalchemy: 1.1.5<br>
pymysql: None<br>
psycopg2: 2.6.2 (dt dec pq3 ext lo64)<br>
jinja2: 2.8<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">xref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="186382820" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14547" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/14547/hovercard" href="https://github.com/pandas-dev/pandas/issues/14547">#14547</a> for other tests</p>
<p dir="auto">In pandas 0.16.2 (and already in 0.16.0), using std() for aggregation after a groupby( 'my_column', as_index=False) modifies 'my_column' by taking its sqrt(). Example:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = pandas.DataFrame({
               'a' : [1,1,1,2,2,2,3,3,3],
               'b' : [1,2,3,4,5,6,7,8,9],
})
df.groupby('a',as_index=False).std()
Out[5]: 
          a  b
0  1.000000  1
1  1.414214  1
2  1.732051  1"><pre class="notranslate"><span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>({
               <span class="pl-s">'a'</span> : [<span class="pl-c1">1</span>,<span class="pl-c1">1</span>,<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">2</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>,<span class="pl-c1">3</span>,<span class="pl-c1">3</span>],
               <span class="pl-s">'b'</span> : [<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>,<span class="pl-c1">4</span>,<span class="pl-c1">5</span>,<span class="pl-c1">6</span>,<span class="pl-c1">7</span>,<span class="pl-c1">8</span>,<span class="pl-c1">9</span>],
})
<span class="pl-s1">df</span>.<span class="pl-en">groupby</span>(<span class="pl-s">'a'</span>,<span class="pl-s1">as_index</span><span class="pl-c1">=</span><span class="pl-c1">False</span>).<span class="pl-en">std</span>()
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]: 
          <span class="pl-s1">a</span>  <span class="pl-s1">b</span>
<span class="pl-c1">0</span>  <span class="pl-c1">1.000000</span>  <span class="pl-c1">1</span>
<span class="pl-c1">1</span>  <span class="pl-c1">1.414214</span>  <span class="pl-c1">1</span>
<span class="pl-c1">2</span>  <span class="pl-c1">1.732051</span>  <span class="pl-c1">1</span></pre></div>
<p dir="auto">The square root values of 'a' are returned instead of 1, 2, 3.</p>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.9.final.0<br>
python-bits: 32<br>
OS: Windows<br>
OS-release: 7<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 45 Stepping 7, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: fr_CH</p>
<p dir="auto">pandas: 0.16.2<br>
nose: 1.3.4<br>
Cython: 0.22<br>
numpy: 1.9.2<br>
scipy: 0.15.1<br>
statsmodels: None<br>
IPython: 3.0.0<br>
sphinx: 1.3.1<br>
patsy: 0.3.0<br>
dateutil: 2.4.0<br>
pytz: 2015.2<br>
bottleneck: None<br>
tables: 3.1.1<br>
numexpr: 2.4<br>
matplotlib: 1.4.3<br>
openpyxl: None<br>
xlrd: 0.9.3<br>
xlwt: None<br>
xlsxwriter: 0.7.1<br>
lxml: None<br>
bs4: 4.3.2<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: 0.9.9<br>
pymysql: None<br>
psycopg2: None</p>