<p dir="auto">I have a question regarding the new is_file_like function and its usage in IO functions like read_csv</p>
<p dir="auto">This new change in pandas 0.20 breaks many codes which previously assume that a file-like object is just an object possessing <code class="notranslate">read</code> or <code class="notranslate">write</code> method.</p>
<p dir="auto">Is there any specific reason we have to enforce such conditions?</p>
<p dir="auto">When making such changes why we have to break the previous behaviors?</p>
<p dir="auto">related <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28538217" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6512" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6512/hovercard" href="https://github.com/pandas-dev/pandas/issues/6512">#6512</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28601637" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6524" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6524/hovercard" href="https://github.com/pandas-dev/pandas/issues/6524">#6524</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="27560102" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6346" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6346/hovercard" href="https://github.com/pandas-dev/pandas/issues/6346">#6346</a></p>
<p dir="auto"><em>Update from <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hayd/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hayd">@hayd</a> I think these should reference <code class="notranslate">_selected_obj</code> rather than <code class="notranslate">obj</code>.</em></p>
<p dir="auto">Looking through some others, looks these also ignore the selection</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> count <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> corr <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> cummax <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> cummin <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> cumsum <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> cumprod  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> describe <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> fillna <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> quantile <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> head <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28668446" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6533" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6533/hovercard" href="https://github.com/pandas-dev/pandas/pull/6533">#6533</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> hist? the output is ok but the plots have all</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ohlc? possibly fixed with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a> (resample with ohlc is tested), should this method exist? see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29145987" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6594" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6594/hovercard" href="https://github.com/pandas-dev/pandas/issues/6594">#6594</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> plot</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> rank <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> tail <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28668446" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6533" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6533/hovercard" href="https://github.com/pandas-dev/pandas/pull/6533">#6533</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> filter, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a> (tested in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29145549" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6593" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6593/hovercard" href="https://github.com/pandas-dev/pandas/pull/6593">#6593</a>)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> resample, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> nth <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28984684" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6569" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6569/hovercard" href="https://github.com/pandas-dev/pandas/pull/6569">#6569</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> diff/shift, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> all/any <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> ffill, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> pct_change  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> idxmin/idxmax, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> dtypes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> apply  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28987607" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6570" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6570/hovercard" href="https://github.com/pandas-dev/pandas/pull/6570">#6570</a> (could be tested more / different paths?)</li>
</ul>
<p dir="auto">Aggregation functions like (they already <em>kind</em> of do, but they allow bad selections ie column names not in columns, may be sep issue?):</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> sum/max/min/median/mean/var/std/.. (not tested)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> agg (not tested)<br>
(these "work" with the described bug)</li>
</ul>
<p dir="auto">Atm selecting a column not in df doesn't raise:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox">  it should raise a Key Error, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29039689" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6578" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/6578/hovercard" href="https://github.com/pandas-dev/pandas/pull/6578">#6578</a></li>
</ul>
<p dir="auto">what about <code class="notranslate">iloc/loc/ix</code> (current all disabled)?</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> iloc (very similar to head/tail)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> loc/ix (maybe push off for now, this is pretty tricky)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> iterate over all (whitelisted) functions to check they adhere to this</li>
</ul>
<p dir="auto">The column selection on a groupby object is being ignored when <code class="notranslate">.quantile()</code> is called. So it computes the quantile on all the (numeric) columns and returns the full DataFrame.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [92]: t = pd.DataFrame(np.random.randn(10, 4)); t[0] = np.hstack([np.ones(5), np.zeros(5)])

In [95]: t.groupby(0)[[1, 2]].quantile()  # shows other cols
Out[95]: 
   0         1         2         3
0                                 
0  0  0.127152  0.108908  0.369601
1  1 -0.321279  0.265550 -0.382398

In [96]: t[[1, 2]].groupby(t[0]).quantile()  # Should be equivalent to:
Out[96]: 
          1         2
0                    
0  0.127152  0.108908
1 -0.321279  0.265550"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">92</span>]: <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">10</span>, <span class="pl-c1">4</span>)); <span class="pl-s1">t</span>[<span class="pl-c1">0</span>] <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">hstack</span>([<span class="pl-s1">np</span>.<span class="pl-en">ones</span>(<span class="pl-c1">5</span>), <span class="pl-s1">np</span>.<span class="pl-en">zeros</span>(<span class="pl-c1">5</span>)])

<span class="pl-v">In</span> [<span class="pl-c1">95</span>]: <span class="pl-s1">t</span>.<span class="pl-en">groupby</span>(<span class="pl-c1">0</span>)[[<span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">quantile</span>()  <span class="pl-c"># shows other cols</span>
<span class="pl-v">Out</span>[<span class="pl-c1">95</span>]: 
   <span class="pl-c1">0</span>         <span class="pl-c1">1</span>         <span class="pl-c1">2</span>         <span class="pl-c1">3</span>
<span class="pl-c1">0</span>                                 
<span class="pl-c1">0</span>  <span class="pl-c1">0</span>  <span class="pl-c1">0.127152</span>  <span class="pl-c1">0.108908</span>  <span class="pl-c1">0.369601</span>
<span class="pl-c1">1</span>  <span class="pl-c1">1</span> <span class="pl-c1">-</span><span class="pl-c1">0.321279</span>  <span class="pl-c1">0.265550</span> <span class="pl-c1">-</span><span class="pl-c1">0.382398</span>

<span class="pl-v">In</span> [<span class="pl-c1">96</span>]: <span class="pl-s1">t</span>[[<span class="pl-c1">1</span>, <span class="pl-c1">2</span>]].<span class="pl-en">groupby</span>(<span class="pl-s1">t</span>[<span class="pl-c1">0</span>]).<span class="pl-en">quantile</span>()  <span class="pl-c"># Should be equivalent to:</span>
<span class="pl-v">Out</span>[<span class="pl-c1">96</span>]: 
          <span class="pl-c1">1</span>         <span class="pl-c1">2</span>
<span class="pl-c1">0</span>                    
<span class="pl-c1">0</span>  <span class="pl-c1">0.127152</span>  <span class="pl-c1">0.108908</span>
<span class="pl-c1">1</span> <span class="pl-c1">-</span><span class="pl-c1">0.321279</span>  <span class="pl-c1">0.265550</span></pre></div>
<p dir="auto">Seeing all these, I'm wondering if this is a bug or just how some of the methods are implementer. The <a href="http://pandas.pydata.org/pandas-docs/dev/groupby.html#dataframe-column-selection-in-groupby" rel="nofollow">docs</a> don't mention anything about only supporting some methods though.</p>
<p dir="auto">version: '0.12.0-883-g988d4be'</p>