Why is it so complicated to access a row in a DataFrame?

Indeed row-lookup is an important use case. And as it was already commented here it is not easy to design a good API. The biggest issue is that the condition you might want to use could return exactly one row, or multiple rows (where 0 rows is a special case of multiple).

I want to add something more user friendly in 1.7 release. But we need to discuss how you would want to achieve this. The discussion is in:

I assume that your use case is for situation that you expect an exactly one match, so essentially, what you want is a shorter way of writing only(filter(:id => ==(3), df).age)) (or some alternative syntax already available that was mentioned above). Is this correct?

Can you please comment in the linked issue, so that we can move forward with the decisions?

5 Likes