[Python-ideas] PEP pre-draft: Support for indexing with keyword arguments

Stefano Borini stefano.borini at ferrara.linux.it
Fri Jul 4 17:44:30 CEST 2014


On Fri, Jul 04, 2014 at 08:25:13AM +0200, Stefano Borini wrote:
> On 7/3/14 11:48 PM, Nick Coghlan wrote:
>> Some more concrete pandas-based examples could definitely help make a
>> more compelling case. I genuinely think the hard part here is to make
>> the case for offering the feature *at all*, so adding a "here is
>> current real world pandas based code" and "here is how this PEP could
>> make that code more readable" example could be worthwhile.
>
> I agree. I will examine pandas this evening for more context.


Ok, I examined pandas, and I think it solves a completely different problem

In [27]: df.loc[:,['A','B']]
Out[27]: 
                   A         B
2013-01-01  0.469112 -0.282863
2013-01-02  1.212112 -0.173215


Pandas is naming the columns. With keyword arguments you would be naming the _axes_.



More information about the Python-ideas mailing list